how to insert records from a text file into a table [message #177951] |
Sun, 18 June 2006 07:49 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
emadbsb
Messages: 334 Registered: May 2005 Location: egypt
|
Senior Member |
![emadbsb](/forum/theme/orafaq/images/yahoo.png)
|
|
Hii all
I have a text file that contains a records of a table and are semiconom delemited
that text file is in that form:
10;emad
20;pero
30;manoon
40;fady
i want to insert these records to a table of that description
Quote: | create table try (
code number,
name varchar2(10));
|
Thanks for everyone Helped me and helping me
|
|
|
|
|
Re: how to insert records from a text file into a table [message #178011 is a reply to message #177951] |
Mon, 19 June 2006 01:21 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
emadbsb
Messages: 334 Registered: May 2005 Location: egypt
|
Senior Member |
![emadbsb](/forum/theme/orafaq/images/yahoo.png)
|
|
i used the "text_io" function in this issue
Quote: | DECLARE
IN_FILE TEXT_IO.FILE_TYPE;
INS_PATH VARCHAR2(50):= 'D:\REPORT.txt' ;
vCUSTOMER CHAR(200);
BEGIN
IN_FILE :=TEXT_IO.FOPEN(INS_PATH,'R');
TEXT_IO.GET_LINE(OUT_FILE,vCUSTOMER);
MESSAGE (vTRY);
MESSAGE (vTRY);
TEXT_IO.FCLOSE (OUT_FILE);
EXCEPTION
WHEN OTHERS THEN
TEXT_IO.FCLOSE (OUT_FILE);
MESSAGE(SQLERRM);
END;
|
But this code takes "lines" doesnot see the delimter "semiconom"
and also it reads the first line only
and i don't know how to loop on that text file
[Updated on: Mon, 19 June 2006 01:23] Report message to a moderator
|
|
|
|
|
|
|
|