Home » Developer & Programmer » Forms » How to Export Text File in Oracle 8[URGENT]?
icon5.gif  How to Export Text File in Oracle 8[URGENT]? [message #509457] Fri, 27 May 2011 20:56 Go to next message
faithima
Messages: 37
Registered: April 2011
Location: Philippines
Member

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. Sad

Thanks & Regards,
Faith
Re: How to Export Text File in Oracle 8[URGENT]? [message #509468 is a reply to message #509457] Sat, 28 May 2011 02:43 Go to previous messageGo to next message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
I'm not sure what the problem is.
You know how to read a file, what's stopping you writing one?
Re: How to Export Text File in Oracle 8[URGENT]? [message #509469 is a reply to message #509468] Sat, 28 May 2011 02:52 Go to previous message
faithima
Messages: 37
Registered: April 2011
Location: Philippines
Member

hi cookiemonster,

yeah..actually, I solved my problem.
a little research while waiting for your response. Smile
it's just READ(r) = import, WRITE(w) = export..
I was just a little short-tempered when I don't get my queries right..Smile
Thanks for your response..Smile
Looking forward for another question and (my)answer.. Razz

Regards,
Faith
Previous Topic: when-validate-record trigger
Next Topic: Error in oracle forms 10g (merged 3)
Goto Forum:
  


Current Time: Sat Sep 07 15:42:51 CDT 2024