|
Using the
following code;
try
{ db.begin(); OQLQuery query = db.getOQLQuery( "SELECT c FROM " + Customer.class.getName() + " c " + "WHERE shortName = \" ABC \"" ); QueryResults results = query.execute();
...etc
Customer is a
simple bean with two fields; number and shortName.
Running this
code throws the following Exception;
org.exolab.castor.jdo.PersistenceException: Nested error:
com.sybase.jdbc2.jdbc.SybSQLException: Incorrect syntax near 'myview.'. while
executing
SELECT
"myview"."cust_number","myview"."short_name" FROM "myview" WHERE
("myview"."cust_short_name" = 'ABC' )
Anybody have any
ideas? The spacing is correct but the introduction of the double quotes
worry me. If I execute the formatted SQL query in a database interpreter I
get the same 'incorrect syntax' problem. If I ditch the quotes it works
fine.
The only other
unusual thing is that column 'number' is in fact a char(8) - I don't have
control over the view that contains the customer data. However, it looks
like this is not the issue here.
Thanks,
Robert
Pieper
|
