text_io syntax [message #79175] |
Fri, 10 May 2002 01:08 |
Rich Anthony
Messages: 1 Registered: May 2002
|
Junior Member |
|
|
What is the correct text_io syntax I would need to use to output the value of a variable to an external file. I am wanting to put the code into a pre query block level trigger.
|
|
|
Re: text_io syntax [message #79194 is a reply to message #79175] |
Tue, 14 May 2002 14:57 |
Srinivas Konda
Messages: 29 Registered: October 2001
|
Junior Member |
|
|
Using TEXT_IO constructs example
Below is an example of a procedure that echoes the contents of a file. Notice that the procedure includes several calls to TEXT_IO constructs:
PROCEDURE echo_file_contents IS
in_file Text_IO.File_Type;
linebuf VARCHAR2(1800);
filename VARCHAR2(30);
BEGIN
filename:=GET_FILE_NAME('c:temp', File_Filter=>'Text Files (*.txt)|*.txt|');
in_file := Text_IO.Fopen(filename, 'r');
LOOP
Text_IO.Get_Line(in_file, linebuf);
:text_item5:=:text_item5||linebuf||chr(10);
--Text_IO.New_Line;
END LOOP;
EXCEPTION
WHEN no_data_found THEN
Text_IO.Put_Line('Closing the file...');
Text_IO.Fclose(in_file);
END;
|
|
|