If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Identifying End-of-File in PL/SQL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-18-03, 17:03
arun1581 arun1581 is offline
Registered User
 
Join Date: Dec 2003
Location: US
Posts: 4
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
Reply With Quote
  #2 (permalink)  
Old 12-19-03, 02:22
cvandemaele cvandemaele is offline
Registered User
 
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On