A script-enabled browser is required for this page to function properly.

TEXT_IO.GET_LINE built-in procedure

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

Syntax


PROCEDURE TEXT_IO.GET_LINE
 (file file_type,
 item OUT VARCHAR2);

Parameters

Parameter

Description

file

A variable that specifies an open file.

item

A variable used to hold the next line read.

Example


 /*
  ** 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;

See also

About the TEXT_IO built-in package

TEXT_IO built-in package