Return values from sqlplus to Shell script [message #98072] |
Mon, 19 January 2004 20:12 |
Prabha R
Messages: 21 Registered: October 2001
|
Junior Member |
|
|
Hi,
I am calling a sql script inside a unix shell. This sql script will run a query and spool the output to a txt file. I would like to know whether this sql script ran successfully with correct output. I am facing 2 problems here:
1) If there is any connection error due to invalid username/password, the command hangs prompting for "Username" or "Password". Since this shell script will be automated, the job will be hanging forever as it requires input. How do i capture such errors and end the process?
2) Since i am spooling the query output to a file, even when the query throws any Oracle error, it will be written to the outputfile. The next step will be loading this output file data into another table. If there is any wrong data in the outputfile, i do not want to call the load process at all. But since there could be range of Oracle errors that can happen, I do not know how to find this and stop the next step.
Can anybody pls help me out in solving this. Your immediate help will be greatly appreciated.
Thanks,
prabha.
|
|
|
|
|