ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harkness, David" <DHarkn...@sonypictures.com>
Subject RE: Compiling PL/SQL
Date Fri, 27 Aug 2004 17:55:41 GMT
Jérôme Grelier penned
> I would like to compile several PL/SQL packages via the sql task.

You could use <exec> to run SQL*Plus directly and -- I assume (oops) -- check the exit
code. I only played around with it a little, but I never tested the error handling. Here's
the code I used:

    <exec executable="sqlplus" output="db-init-lookup-identity.log">
        <arg value="-S"/>
        <arg value="${identity_app.db.user}/${identity_app.db.pwd}@${identity_app.db.sid}"/>
        <arg value="@db/lookup.sql"/>
    </exec>

The -S flag tells SQL*Plus to not spit out version and connection information (silent mode).
The third argument is the SQL script to execute. You could of course put the connection information
into the script as well, I believe that by putting

    whenever sqlerror exit sql.sqlcode

at the start of your script, SQL*Plus should pass along any error code to Ant, but again I
haven't tried it.

-- 
David Harkness                               Sony Pictures Digital
Sr. Software Engineer   310.482.4756    dharkness@sonypictures.com

        Those who judge the value of advice by its source
        will at once dismiss the best and follow the worst.

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


Mime
View raw message