TEXT_IO.GET_LINE
built-in procedureThis procedure retrieves the next line of an open file and places it in item
.
TEXT_IO.GET_LINE
reads characters until a newline character (that
is, carriage return) is read or an end-of-file (EOF) condition is encountered.
If the line to be read exceeds the size of item
, the Value_Error
exception is raised. If there are no more characters remaining in the file,
the No_Data_Found
exception is raised.
PROCEDURE TEXT_IO.GET_LINE
(file file_type,
item OUT VARCHAR2);
Parameter |
Description |
|
A variable that specifies an open file. |
|
A variable used to hold the next line read. |
/*
** Open a file and read the first line
** into linebuf.
*/
Declare
in_file TEXT_IO.FILE_TYPE;
linebuf VARCHAR2(80);
Begin
in_file := TEXT_IO.FOPEN ('salary.txt', 'r');
TEXT_IO.GET_LINE (in_file,linebuf);
End;
About the TEXT_IO
built-in package
Copyright © 1984, 2005, Oracle. All rights reserved.