This is with 2.1, and I'm totally baffled... I have this method:
public static void gonzo(String dbName, String value)
{
Log.debug("DB: [" + dbName + "]");
String sql1 = "SELECT * FROM MY_TABLE WHERE FLD1 = '" + value + "'";
Log.debug("SQL 1 is [" + sql1 + "]");
int rows1 = MyTablePeer.executeStatement(sql1, dbName);
Log.debug("SQL 1 returned " + rows1 + " rows");
Criteria where = new Criteria(dbName);
where.add(MyTablePeer.FLD1, value);
Vector data = MyTablePeer.doSelect(where);
Log.debug("SQL 2 returned " + data.size() + " rows");
}
This whole thing is against an Oracle DB. Field MY_TABLE.FLD1
is a VARCHAR2(10).
SQL 1 prints 2 rows as returned; SQL 2 prints 0.
I have SQL logging enabled; if I take the SQL code generated
for SQL 2 (which looks pretty much like the code for SQL 1)
and run it directly on SQLPLUS, it returns 2 rows!
Anybody can provide any suggestions? I'm really puzzled and
don't know what else to try; the code looks like it MUST work!
--
Gonzalo A. Diethelm
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]