You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Harkness, David" <DH...@sonypictures.com> on 2004/04/01 23:52:02 UTC

RE: using set command in the sql task

Edward Peloke wrote:
> I am using the sql task to run a script into my ORacle db.
> The script runs fine unless I use a Set command such as
> 
> SET DEFINE ON, etc.  IF those are in the scripts, I get an
> invalid option error.

It is my understanding that the <sql> task actually uses JDBC directly
to issue your queries and such -- it doesn't go through SQL*Plus.

> How can I get around this?

You can call SQL*Plus directly with the following.

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

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


RE: using set command in the sql task

Posted by Edward Peloke <ep...@echoman.com>.
Thanks David,

That was my next move.  I was hoping to get it to work without using sql
plus.  The bad part about using SQL plus is that it won't fail on a sql
error...correct?  I will need to somehow parse through the output looking
for an error message to know there was a problem.

Thanks,
Eddie

-----Original Message-----
From: Harkness, David [mailto:DHarkness@sonypictures.com]
Sent: Thursday, April 01, 2004 4:52 PM
To: Ant Users List
Subject: RE: using set command in the sql task


Edward Peloke wrote:
> I am using the sql task to run a script into my ORacle db.
> The script runs fine unless I use a Set command such as
>
> SET DEFINE ON, etc.  IF those are in the scripts, I get an
> invalid option error.

It is my understanding that the <sql> task actually uses JDBC directly
to issue your queries and such -- it doesn't go through SQL*Plus.

> How can I get around this?

You can call SQL*Plus directly with the following.

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

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


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