Is it possible to do something like this in Oracle 10g, ojdbc14.jar?
I can't seem to get any results back. It's fine if I loop through
each item and use " my_column = ?", but I'm not able to use Oracle's
sorting.
String sql = "select * from my_table where my_column in (?) order by
other_column";
OraclePreparedStatement pstmt =
(OraclePreparedStatement)conn.prepareStatement(sql);
String sList = " 'item1','item2','item3' ";
pstmt.setFixedChar(1, sList);
ResultSet rslt = pstmt.executeQuery();
joeNOSPAM@BEA.com - 03 Jul 2007 04:27 GMT
> Is it possible to do something like this in Oracle 10g, ojdbc14.jar?
> I can't seem to get any results back. It's fine if I loop through
[quoted text clipped - 8 lines]
> pstmt.setFixedChar(1, sList);
> ResultSet rslt = pstmt.executeQuery();
Nope. The semantics of parameters are specific and constrained. They
are precisely one data value each. The prepared statement is
associated
with a precompiled query plan in the DBMS, and such plans cannot
typically
be created with general gaps in their semantics.
Joe Weinstein at BEA Systems
dweesie - 03 Jul 2007 15:02 GMT