Capture Sql Error when execute in CMD file

Posted by sarah xia on Stack Overflow See other posts from Stack Overflow or by sarah xia
Published on 2010-04-29T04:44:14Z Indexed on 2010/04/29 5:07 UTC
Read the original article Hit count: 501

Filed under:
|

Hi,

I am writing a CMD file which runs a bunch of sql files, like this:

:: Running every sql file in the temp directory

For %%G IN (.\install\*.sql) DO (

:: run sql script echo exit | sqlplus interacct/interacct @%%G

)

My question is how do I capture an error when one of the scripts didn't succeed?

Thankyou.

Sarah

© Stack Overflow or respective owner

Related posts about sql

Related posts about cmd