How to Export Text File in Oracle 8[URGENT]? [message #509457] |
Fri, 27 May 2011 20:56 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](//www.gravatar.com/avatar/68af9ecb4cd434fb30dfdff2759001a1?s=64&d=mm&r=g) |
faithima
Messages: 37 Registered: April 2011 Location: Philippines
|
Member |
![faith_sakura01%40yahoo.com](/forum/theme/orafaq/images/yahoo.png)
|
|
Hi,
Just want to know on how to export text file
from oracle? I have here the query on how to import.
begin
in_file := TEXT_IO.FOPEN(:path_file,'r');
LOOP
BEGIN
SYNCHRONIZE;
TEXT_IO.GET_LINE (in_file, linebuff);
v_no_errors := TRUE;
txt := LTRIM(RTRIM(linebuff));
if chk_unq(txt) then
begin
select count(*) into chktmp
from TKS_CONTROL
where payroll_id = :global.pay_id and
control_no2 = substr(txt,13,6);
end;
if chktmp > 0 AND substr(txt,13,6) =
nvl(CTRL_NO,substr(txt,13,6)) then
insert into tks_txt_temp(tkstxt) values(txt); --- if NE or EX
:mess := cat||'-Uploading records... '||txt; --- connection.
-- message(txt);message(txt);
else
:mess := 'Skipping ..... '||txt;
end if; ---
end if;
EXCEPTION
WHEN NO_DATA_FOUND THEN
TEXT_IO.FCLOSE(in_file);
TEXT_IO.FCLOSE(out_file);
EXIT;
WHEN VALUE_ERROR THEN
TEXT_IO.PUT_LINE(out_file,linebuff);
null;
WHEN others THEN null;
END;
END LOOP;
commit;
EXCEPTION
WHEN others
THEN message('Data error .. Pls. check your text file.');
message('Data error .. Pls. check your text file.');
END;
But this is my first time to export the text file.
Please help.
Thanks & Regards,
Faith
|
|
|
|
|