ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harkness, David" <DHarkn...@sonypictures.com>
Subject RE: using set command in the sql task
Date Thu, 01 Apr 2004 23:36:05 GMT
Edward Peloke wrote:
> The bad part about using SQL plus is
> that it won't fail on a sql error...correct?

A little digging turned up the following, from

 
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a90842/ch13
.htm#1014742

and

 
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a90842/ch13
.htm#1014649

You can tell SQL*Plus to do various things when you get a SQL and/or OS
error. For example,

  WHENEVER SQLERROR EXIT FAILURE ROLLBACK

This returns some standard "error" code. You can have it return the
Oracle error code using "SQL.SQLCODE" instead of "FAILURE", but I'm not
sure if there are issues with maximum size of error codes between
DOS/Unix and Oracle's error numbers. I guess you'll find out, eh? ;)

Note that it says in many places that it won't trigger the WHENEVER if
there is a SQL*Plus error (e.g. syntax error in a FORMAT command), but
maybe there's a separate command for that.

Why haven't I hit this yet? I've only got one script being run through
Ant and SQL*Plus, and it just does a simple select query -- it's not
part of the build process.

Good luck!

David Harkness
Sr. Software Engineer
Sony Pictures Digital Networks
(310) 482-4756

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message