Help with shell script to execute a sql cursor

Hi All,

I want some help in writing a shell script which will be in the below form:

A logical representation of shell scripts:

->Shell scripts start
->Connect to database
->Execute a sql and store the output in a cursor(need to know is there any concept of cursor in unix)
->Using a loop to take the value from the cursor one by one
->Inside the loop, it will perform the following steps:
a. Copy the file to a different location
b. print the file which is copied
c. delete the file

->The above steps continue till the last value present in the cursor.
-> The shell script should give the output of all the deleted files.

If any one can provide a sample where it will help me in understanding the concept.

Hope I didn't confuse/asked a lot as i am a newbie in learning shell scripts.

Thanks in advance.

Thanks
Chitra

If you go to the bottom of this page - scroll all the way down. See the blue links on the left? Those are threads on the same subject.

No. SQLCURSOR is a memory object internal or oracle. It is transient. That means when you quit an oracle session the resultset the cursor "sees" and the cursor object itself, too - are all gone forever.

Come back after you try what is in those links. Show us what you have and we help you perfect it.