You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Miras Bastien <bm...@yahoo.com> on 2011/08/04 10:20:59 UTC

SQL task and rowcountproperty

Hello,

I'm trying to use the rowcountproperty parameter in the sql task.

My ant code looks like:
<sql
                            driver="oracle.jdbc.driver.OracleDriver"
                            url=" jdbc:oracle:thin:@localhost:11522:TINSTA"
                            userid="${db.user}"
                            password="${db.pwd}" 
                            rowcountproperty="db.data.nbLine">
                            select * from t_product;
</sql>
But the db.data.nbLine property is not updated.

Looking at:
http://javasourcecode.org/html/open-source/ant/ant-1.8.1/org/apache/tools/ant/taskdefs/SQLExec.java.html#line.797

it seems rowcountproperty give a count of updated rows only.
Is it the feature expected?
In this case, how can I get the row number using a SELECT statement?

thanks,

Bastien

Re: SQL task and rowcountproperty

Posted by Andy Stevens <in...@googlemail.com>.
On 4 August 2011 09:20, Miras Bastien <bm...@yahoo.com> wrote:
> I'm trying to use the rowcountproperty parameter in the sql task.
>
> My ant code looks like:
> <sql
>                             driver="oracle.jdbc.driver.OracleDriver"
>                             url=" jdbc:oracle:thin:@localhost:11522:TINSTA"
>                             userid="${db.user}"
>                             password="${db.pwd}"
>                             rowcountproperty="db.data.nbLine">
>                             select * from t_product;
> </sql>
> But the db.data.nbLine property is not updated.
>
> Looking at:
> http://javasourcecode.org/html/open-source/ant/ant-1.8.1/org/apache/tools/ant/taskdefs/SQLExec.java.html#line.797
>
> it seems rowcountproperty give a count of updated rows only.
> Is it the feature expected?
> In this case, how can I get the row number using a SELECT statement?

Would
                             select rownum, * from t_product;
do what you need?


Andy.
-- 
http://www.justgiving.com/AndyStevens-Bikeathon2011
Raising money for Leukaemia Research

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