Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003
    Location
    US
    Posts
    4

    Unanswered: Identifying End-of-File in PL/SQL

    Hi,

    I am writing a program which will run on multiple files in a directory. The program is working good for 1 file, but doesn't go in a loop to read other files. I am reading file names from a table into a cursor.

    Problem is that after reading first file till the end, it will exit out of the loop instead of going back to fetch another file. This is happening because after reading first file till the end there is no condition to verify end of file and return back to the loop.

    The files may have multiple blank lines in between, so the concept of looking for a couple of new line characters chr(30) at the end won't work for me.

    Any idea!
    Thanks,

    Arun

  2. #2
    Join Date
    Oct 2003
    Location
    Switzerland
    Posts
    140
    If you are using Oracle's "utl_file.get_line", then you can trap the NO_DATA_FOUND exception, which indicates that the end of the file has been reached.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •