Hi all; here's hoping you've got better eyes than me.
Code:
String sql = "select duration, dialed_number, st from " +
"(select duration, dialed_number, to_char(start_time, " +
"'YYYY-MM-DD HH24:MI:SS AM') st, row_number() over " +
"(order by start_time desc) r from billing_record where " +
"subscriber_id = ?) where r between 1 and ?";
PreparedStatement vStatement = vConn.prepareStatement(sql);
vStatement.setInt(1, subscriberid);
vStatement.setInt(2, numCalls);
ResultSet rs = vStatement.executeQuery(sql);
Error:
java.sql.SQLException: ORA-01008: not all variables bound
I'm damn sure that I've only got two variables in the SQL statement, and
that I'm setting both of them. What's going on here?

Signature
Peter Davies
Jacques-Olivier Haenni - 24 Jan 2006 13:05 GMT
Hi,
Why do you want to pass the SQL string as argument to
vStatement.executeQuery?
Just do 'ResultSet rs = vStatement.executeQuery()' and it'll work fine.
Jacques-Olivier
>Hi all; here's hoping you've got better eyes than me.
>
[quoted text clipped - 17 lines]
>
>
Peter Davies - 24 Jan 2006 13:45 GMT
>>Hi all; here's hoping you've got better eyes than me.
>>
[quoted text clipped - 24 lines]
>
> Jacques-Olivier
AHA!
Glad it was a simple problem. Thanks!

Signature
Peter Davies