Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Within SQL*Plus, get error code of host command

user13117585Nov 16 2011 — edited Apr 25 2013
Hello everyone,

I am currently writing an SQL*Plus (Oracle 10g) that has a big logic and somewhere in the middle, I have to call a host command, which is an C++ function.

I call it using
SQL> HOST cd
SQL> HOST cd bins
SQL> HOST ./my_procedure
But, I need to get the return code of my procedure to see if it finished correctly?

I checked [the manual|http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch4.htm#sthref883] but they don't say anything about return codes.

When I try:
SQL> host echo $?
0
It always returns 0, even if I SIGTERM or SIGKILL the child process. Anyone has an idea on how is it possible to retrieve the return code?

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 23 2013
Added on Nov 16 2011
14 comments
3,598 views