ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chuck Holzwarth <chuck_holzwa...@yahoo.com>
Subject Re: How to assign a result of sqltask to variable
Date Wed, 07 May 2008 13:24:29 GMT
I don't have any experience with the sql task, but I have faced this type of thing in the past
and solved it by using the echo task to create a file with something like "<property_name>="
and then use another task to append to the file by setting the command output to use the same
file with append=true. This generates a file with contents similar to "<property_name>=value".
I then use loadproperties to load the resulting file.

 Thank you,
Chuck Holzwarth
(804) 403-3478 (home)
(540) 335-3171 (cell)



----- Original Message ----
From: Jeremy Weber <jeremy.weber@activevos.com>
To: Ant Users List <user@ant.apache.org>
Sent: Tuesday, May 6, 2008 5:51:23 PM
Subject: Re: How to assign a result of sqltask to variable

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


      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message