Using Cursor in Unix - How to do it (Need Help)

Hi,

I have a table in which i have the following data

 
JOB_NO FILE_ID FILE_NAME
1546148 1378788 PDF Sample -1.pdf
1546148 1378789 PDF Sample -2.pdf
1546149 1378790 PDF Sample -3.pdf

Now I would like use a cursor like thing in unix to download the files using the file ids and send them to printer

 
//downloads the file from into PDF format
FNDGFU $apps_user/$apps_pwd 0 Y DOWNLOAD=$FILE_ID $FILENAME 
 
//Sending the File to printer
lp -d $PRINTER $FILENAME.pdf

How can I use a cursor like condition to loop the data??

Thanks,
Neil

You can read a stream of data line by line

while read jobline; do
   # interesting stuff goes here, parsing the line... do you know how to do that?
done <table-source

You could also read the whole stream of data into a variable... and process on that... IF the amount of data isn't extremely large.