Although I would prefer not to create the file, I ended up going with the following solution:
The sql task is invoked as follows
<sql ... print="yes" output="temp.properties" expandProperties="true" showheaders="false" showtrailers="false" > <![CDATA[ select 'current.sp.version=' || NAME from SERVICE_PACK; select 'current.major.version=' || NAME from VERSION; ]]> </sql>
The generated properties file will contain:
current.sp.version=03 current.major.version=5
Then you just upload the properties file and delete it:
<property file="temp.properties" /> <delete file="temp.properties" /> <echo message="Current service pack version: ${current.sp.version}" /> <echo message="Current major version: ${current.major.version}" />
It works, and everything is right there in the ant script (even if it's not the most beautiful thing in the world!).
zakvdm
source share