*** data transfer from .txt file to table *** [message #77940] |
Wed, 19 December 2001 18:53  |
Robin
Messages: 73 Registered: October 2001
|
Member |
|
|
Exparts,
I can export data to a .lst file by spool command. But can not import data from that .lst file to table.How can I do it? Please help me.
thanks
robin.
----------------------------------------------------------------------
|
|
|
|
Re: *** data transfer from .txt file to table *** [message #313469 is a reply to message #77940] |
Sat, 12 April 2008 13:48  |
owais_baba
Messages: 289 Registered: March 2008 Location: MUSCAT
|
Senior Member |
|
|
hi mr robin
try this
DECLARE
OPEN_FILE Text_IO.File_Type;
LINE_VALUE VARCHAR2(80);
FILENAME VARCHAR2(10) :='C:XYZ.txt';
BEGIN
OPEN_FILE := Text_IO.Fopen(FILENAME, 'a');
LOOP
Text_IO.Get_Line(OPEN_FILE, LINE_VALUE);
Text_IO.Put(LINE_VALUE);
IF SUBSTR(LINE_VALUE,1,3) = 'CTR' THEN
INSERT INTO CONT VALUES(SUBSTR (LINE_VALUE,4,14));
END IF;
Text_IO.New_Line;
END LOOP;
COMMIT;
EXCEPTION
WHEN no_data_found THEN
SET_ALERT_PROPERTY
('MESS',ALERT_MESSAGE_TEXT,'FILE IS GOING TO CLOSE');
MESS;
Text_IO.Fclose(OPEN_FILE);
END;
owais
|
|
|