You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by I am Who i am <ra...@gmail.com> on 2008/05/06 23:41:56 UTC

How to assign a result of sqltask to variable

Hi All

How to assign a result of sqltask to variable

E.g.

Lets say i have this in my build.xml

<sql
    driver="oracle.jdbc.driver.OracleDrive"
    url="jdbc:database-url"

    userid="sa"
    password="pass"
    >
SELECT user_id FROM user where user_name=${user.name};
</sql>

in this how do i assign user_id now to any variable,?

Please help

Re: How to assign a result of sqltask to variable

Posted by Jeremy Weber <je...@activevos.com>.
You cant directly, but you might be able to use the output attribute to 
store the user_id in a file and then read the contents of the file into 
a property with LoadFile.  Its worth a shot, but I wonder if you will 
get more information in the file than just user_id.

I am Who i am wrote:
> Hi All
>
> How to assign a result of sqltask to variable
>
> E.g.
>
> Lets say i have this in my build.xml
>
> <sql
>     driver="oracle.jdbc.driver.OracleDrive"
>     url="jdbc:database-url"
>
>     userid="sa"
>     password="pass"
>     >
> SELECT user_id FROM user where user_name=${user.name};
> </sql>
>
> in this how do i assign user_id now to any variable,?
>
> Please help
>
>   


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