Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to know in a unix script if oracle procedure executed or failed?
"vishal" <c_vishal_at_hotmail.com> a écrit dans le message de
news:24327b26.0312101318.5b1c4f4c_at_posting.google.com...
> Hi,
>
> I am writing my first script to execute a Oracle procedure through a
> unix script. Could you tell me how do I do error handling here? How do
> I know in my script if the procedure executed successfully or failed?
> Thanks
>
> #!/usr/bin/ksh
> sqlplus user/password_at_name <<EOC
> set time on
> set echo on
> select sysdate from dual
> ;
> spool procedureName.log
> exec procedureName
> spool off
> exit
> EOC
(Sorry if double post, there is some problem with my provider.)
You can use the statement "whenever sqlerror exit ..." and test the return code of SQL*Plus. (SQL*Plus User's Guide and Reference, chapter 13: SQL*Plus Command Reference)
Hope this helps
Michel Cadot
Received on Wed Dec 10 2003 - 16:09:09 CST
![]() |
![]() |