怎样用sqlldr 把分块数据存入不同的表中 >定位在第一个“块”>每次读一个数,导入table1,直到块尾>定位在第二个块>每次读一个数,导入table2,直到块尾——最简单的方法往往是最好的方法 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 谢谢上面的兄弟能再详细点吗? 怎么定位阿?比如两个表格都只有一个字段,分别为 result1 ,result2 var f: textfile; temp: string; x: double;beginassignfile(f,filename); //filename是你的文件reset(f);readln(temp); //temp='-1'readln(temp); //如果第一个快只有一行,整行都存在了temp中repeat x:=strtofloat(copy(temp,1,pos(' ',temp)-1)); //取一个数 InsertTable1(x); delete(temp,1,pos(' ',temp));until pos(' ',temp)=0; //pos(' ',temp)=0 表示数已取完readln(temp); //temp='-1'readln(temp); //temp='-1'readln(temp); //temp=第二个数据块repeat x:=strtofloat(copy(temp,1,pos(' ',temp)-1)); //取一个数 InsertTable2(x); delete(temp,1,pos(' ',temp));until pos(' ',temp)=0; //pos(' ',temp)=0 表示数已取完closefile(f);end;procudure InsertTable1(x: double);begin form1.query1.sql.text:='insert into table1 (result1) values (:result1)'; form1.query1.parambyname('result1').asfloat:=x; form1.query1.execsql;end;procudure InsertTable2(x: double);begin form1.query2.sql.text:='insert into table2 (result1) values (:result2)'; form1.query2.parambyname('result2').asfloat:=x; form1.query2.execsql;end; 多谢junerr这段程序在 SQL*Plus 里边运行时出现这样的错误:SP2-0553: 非法的变量名\f:\。SP2-0734: 未知的命令开头 "temp: stri..." - 忽略了剩余的行。SP2-0042: 未知命令"x: double" -- 其余行忽略。SP2-0552: 未说明结合变量"DOUBLE"我把 var 改为 declare 后,还是有错误 :SP2-0552: 未说明结合变量"DOUBLE"我是新手,还望指教,谢谢 declaref textfile;temp string;x double;beginassignfile(f,'e:\Aeronautics\test\noise5.txt'); //filename是你的文件reset(f);readln(temp); //temp='-1'readln(temp); //如果第一个快只有一行,整行都存在了temp中repeatx:=strtofloat(copy(temp,1,pos(' ',temp)-1)); //取一个数InsertTable1(x);delete(temp,1,pos(' ',temp));until pos(' ',temp)=0; //pos(' ',temp)=0 表示数已取完readln(temp); //temp='-1'readln(temp); //temp='-1'readln(temp); //temp=第二个数据块repeatx:=strtofloat(copy(temp,1,pos(' ',temp)-1)); //取一个数InsertTable2(x);delete(temp,1,pos(' ',temp));until pos(' ',temp)=0; //pos(' ',temp)=0 表示数已取完closefile(f);end;procudure InsertTable1(x: double);beginform1.query1.sql.text:='insert into table1 (result1) values (:result1)';form1.query1.parambyname('result1').asfloat:=x;form1.query1.execsql;end;procudure InsertTable2(x: double);beginform1.query2.sql.text:='insert into table2 (result1) values (:result2)';form1.query2.parambyname('result2').asfloat:=x;form1.query2.execsql;end;除了前面的申明部分有点改动,文件名写全之外,其余都没变化,这些程序在sql*plus里边运行多谢相助 说明:本人略懂Delphi ,常在Delphi版快里混, 所以一时糊涂 :)上面给出的代码是Delphi中的你用Delphi 吗?是的话可以把代码放在Delphi中试试要是不用Delphi...我也不知道在sql*plus中用什么命令,或者在其他编程工具中的具体做法但思路可以是一样的 oracle11g安装出现的问题 oracle 11g怎么卸载? oracle的人只需要一分钟就赚分 能exp导出不能Imp导入 上市互联网公司多个DBA相关岗位正在招聘,有需要换工作的兄弟姐妹, 通过代理服务器访问数据库?高手帮忙了! 明天我要改数据库的归档模式,各个文章上看到的方法有出入。不知以下步骤对否? 我为什么见不到见不到资料档案库? 令我烦恼的SQL文.知道写的不对,但是不改.请各位老仙看看能否用一句SQL实现. 请用一句SQL实现 麻烦高手看一下这个SQL语句的实现! oracle中有没有bit(sql server中有)数据类型?
比如两个表格都只有一个字段,分别为 result1 ,result2
temp: string;
x: double;
begin
assignfile(f,filename); //filename是你的文件
reset(f);
readln(temp); //temp='-1'
readln(temp); //如果第一个快只有一行,整行都存在了temp中
repeat
x:=strtofloat(copy(temp,1,pos(' ',temp)-1)); //取一个数
InsertTable1(x);
delete(temp,1,pos(' ',temp));
until pos(' ',temp)=0; //pos(' ',temp)=0 表示数已取完
readln(temp); //temp='-1'
readln(temp); //temp='-1'
readln(temp); //temp=第二个数据块
repeat
x:=strtofloat(copy(temp,1,pos(' ',temp)-1)); //取一个数
InsertTable2(x);
delete(temp,1,pos(' ',temp));
until pos(' ',temp)=0; //pos(' ',temp)=0 表示数已取完
closefile(f);
end;procudure InsertTable1(x: double);
begin
form1.query1.sql.text:='insert into table1 (result1) values (:result1)';
form1.query1.parambyname('result1').asfloat:=x;
form1.query1.execsql;
end;procudure InsertTable2(x: double);
begin
form1.query2.sql.text:='insert into table2 (result1) values (:result2)';
form1.query2.parambyname('result2').asfloat:=x;
form1.query2.execsql;
end;
这段程序在 SQL*Plus 里边运行时出现这样的错误:
SP2-0553: 非法的变量名\f:\。
SP2-0734: 未知的命令开头 "temp: stri..." - 忽略了剩余的行。
SP2-0042: 未知命令"x: double" -- 其余行忽略。
SP2-0552: 未说明结合变量"DOUBLE"我把 var 改为 declare 后,还是有错误 :SP2-0552: 未说明结合变量"DOUBLE"
我是新手,还望指教,谢谢
f textfile;
temp string;
x double;begin
assignfile(f,'e:\Aeronautics\test\noise5.txt'); //filename是你的文件
reset(f);
readln(temp); //temp='-1'
readln(temp); //如果第一个快只有一行,整行都存在了temp中
repeat
x:=strtofloat(copy(temp,1,pos(' ',temp)-1)); //取一个数
InsertTable1(x);
delete(temp,1,pos(' ',temp));
until pos(' ',temp)=0; //pos(' ',temp)=0 表示数已取完
readln(temp); //temp='-1'
readln(temp); //temp='-1'
readln(temp); //temp=第二个数据块
repeat
x:=strtofloat(copy(temp,1,pos(' ',temp)-1)); //取一个数
InsertTable2(x);
delete(temp,1,pos(' ',temp));
until pos(' ',temp)=0; //pos(' ',temp)=0 表示数已取完
closefile(f);
end;procudure InsertTable1(x: double);
begin
form1.query1.sql.text:='insert into table1 (result1) values (:result1)';
form1.query1.parambyname('result1').asfloat:=x;
form1.query1.execsql;
end;procudure InsertTable2(x: double);
begin
form1.query2.sql.text:='insert into table2 (result1) values (:result2)';
form1.query2.parambyname('result2').asfloat:=x;
form1.query2.execsql;
end;除了前面的申明部分有点改动,文件名写全之外,其余都没变化,这些程序在sql*plus里边运行
多谢相助
本人略懂Delphi ,常在Delphi版快里混, 所以一时糊涂 :)
上面给出的代码是Delphi中的
你用Delphi 吗?是的话可以把代码放在Delphi中试试
要是不用Delphi...我也不知道在sql*plus中用什么命令,或者在其他编程工具中的具体做法
但思路可以是一样的