代码如下每条记录POST 一次连本局域网内的ORACLE服务器进行入库
基本上两分钟就搞定了
但是要连接远程的数据库(在广州就很慢了至少要5小时才能完成,)
是光纤连过去的带宽肯定有
有什么办法在程序中或者是ORACLE的配置中优化一下吗?? while (i<edtbaodan.lines.Count) and (copy(edtbaodan.lines[i],length(edtbaodan.lines[i])-9,10)='baodanhead') do
begin
try
table1.close;
table1.open;
j:=0;
table1.insert;
str:=edtbaodan.Lines[i];
while (j<table1.fieldcount-1) do
begin
postion:=pos(',',str);
if j=table1.fieldcount-2 then
begin
if postion<>1 then
table1.fields[j].value :=copy(str,1,postion-1)
else
table1.fields[j].value:=null;
end
else
if postion<>1 then
table1.fields[j].value:=copy(str,1,postion-1)
else
table1.fields[j].value:=null;
str:=copy(str,postion+1,(length(str)-postion));
j:=j+1;
end;//end while
table1.post;
i:=i+1;
StatusBarmsg.Panels[0].text:='正在处理:';
StatusBarmsg.Panels[1].text:='报单成绩,已处理'+inttostr(i)+'条记录,总共有'+inttostr(edtbaodan.lines.Count)+'条记录';
Formsjzr.Refresh;
except
begin
table1.Cancel;
i:=i+1;
continue;
end;
end;//end try
end; //end while i<edtbaodan.lines.Count
基本上两分钟就搞定了
但是要连接远程的数据库(在广州就很慢了至少要5小时才能完成,)
是光纤连过去的带宽肯定有
有什么办法在程序中或者是ORACLE的配置中优化一下吗?? while (i<edtbaodan.lines.Count) and (copy(edtbaodan.lines[i],length(edtbaodan.lines[i])-9,10)='baodanhead') do
begin
try
table1.close;
table1.open;
j:=0;
table1.insert;
str:=edtbaodan.Lines[i];
while (j<table1.fieldcount-1) do
begin
postion:=pos(',',str);
if j=table1.fieldcount-2 then
begin
if postion<>1 then
table1.fields[j].value :=copy(str,1,postion-1)
else
table1.fields[j].value:=null;
end
else
if postion<>1 then
table1.fields[j].value:=copy(str,1,postion-1)
else
table1.fields[j].value:=null;
str:=copy(str,postion+1,(length(str)-postion));
j:=j+1;
end;//end while
table1.post;
i:=i+1;
StatusBarmsg.Panels[0].text:='正在处理:';
StatusBarmsg.Panels[1].text:='报单成绩,已处理'+inttostr(i)+'条记录,总共有'+inttostr(edtbaodan.lines.Count)+'条记录';
Formsjzr.Refresh;
except
begin
table1.Cancel;
i:=i+1;
continue;
end;
end;//end try
end; //end while i<edtbaodan.lines.Count
解决方案 »
- SQL语句分析
- 有关intraweb的小问题,大家帮帮忙吧!我在线等结果
- 关于treeview的展开与迭起
- 请教:在Delphi中怎么定义位置
- DELPHI开发疑问
- TreeView的删除问题///
- 菜鸟的问题--解决后马上送分
- 如果dbgrid的datasource是一个tdataset对象,如何在dbgrid里更改多条记录,然后再一次性提交。
- 如何写回车就可以默认确定组件被击中的代码/
- 哪位大虾擅长HtmlHelp WorkShop例如:Index,HelpContext等,如果写,要详细,最好有文章或下载地址.不要告诉我看英文帮助。
- 急,DELPHI编程如何控制小票打印(如超市的收银打印),高分!!
- 请问如何实现子窗体?急!!
如果网络速度有保障的话,应该不受地域的影响!
兄弟我
用了你的办法
速度是加快了很多
但是一到Table.ApplyUpdates;
就停下来了啊
怎么回事情啊??