Running the same query using the tool generates completely
different data than running in ISQL.
The only issue seen in ISQL is the following error:
NULL value eliminated in aggregate function SQLCODE=109,
ODBC 3 State = "01003".
My java app is not throwing any errors in the execution and
the getWarnings() method returns null.
Is there something happening in the JConnect libraries that
handles this differently than ISQL? Any ideas on how to get
the results to match?
I'll bet you may be setting PreparedStatement parameter
values for search criteria. I ask if the column is a fixed-char-length
datum, and the values you pass in are not padded out to the
full length?
Try sending the SQL from JDBC totally hard-wired.
(Guesses... Let me know more details if I'm off...)
Joe
The most complicated thing about it is the actual query. I
developed it and it works correctly using dbisql, I was
expecting to be able to plug it into my java app without
issue, but here i am.with my only clue the error message
dbisql generates, but ignores.
Here's the basic code:
db = openDatabase("com.sybase.jdbc3.jdbc.SybDriver",
"jdbc:sybase:Tds:"+server+":"+port+"?ServiceName="+=svcName
, usr, pwd);
stmt = db.createStatement();
rs = stmt.executeQuery(db.nativeSQL(generateQuery()));
Where
public string generateQuery(){
StringBuffer sql = new StringBuffer();
sql.append("Select col1, col2, ...");
...
sql.append("from tablename");
return sql.toString();
}
Its a select statement that returns 22 columns and one row.
all values are doubles.
Karim
That looks to have done it. Doesn't make a lot of sense to
me, but whatever. it works.