Srini Venigalla <[email protected]> writes:
> One of the most troublesome issues for PreparedStatement users is the
> coding of the IN clause.
> e.g. Select * from Table1 where A in (1,2,3,4,5) and B=6 and C=7
This is how I do it (using Perl and DBI):
@vals= (1,2,3,4,5);
$dbi->selectall_arrayref("Select * from Table1 where A in (".
join(",", map("?", @vals)) .") and B=? and C=?", undef,
@vals, 6, 7)
No real troubles there...
> It would be nice if I could do this:
>
> n =1;
> ps.setArray(n, Object[] v);
> ps.setInt(n+v.length, 6);
> ps.setInt(n+v.length+1, 7);
Not sure which language you have in mind here (Java/C#?) But it is true that
some SQL bindings are better than others, just as some application languages
have better support for dynamic data structure manipulation than others. DBI
is one of the better SQL bindings I have seen, but I have also seen many
with really poorly designed interfaces.
- Kristian.
_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help : https://help.launchpad.net/ListHelp