Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sybase SP error - Operand type clash: INT is incompatible with DATETIME

 
Raj Aryan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am calling a sybase SP from my application like following:

conn = getSybaseConnection();

procName = " testschema.PlaceOrder";
procStmt = "{?=CALL " + procName + "( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}";

I am setting all other variables and also do like this.

cstmt.setString(2, address);
.....
cstmt.registerOutParameter(1, Types.INTEGER);
cstmt.registerOutParameter(44, Types.INTEGER);
cstmt.registerOutParameter(45, Types.INTEGER);

First '?' and last 2 '?' are out parameters.

But, after execution, I am getting the following error:
"Operand type clash: INT is incompatible with DATETIME"

when I try to access my first out param as:

cstmt.execute();
procStatus = cstmt.getInt(1);

Could someone tell what would be the problem?

Thanks in advance,
Raj A
 
Campbell Ritchie
Sheriff
Pie
Posts: 50225
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please alter your log-on name to conform with the Ranch's naming policy.

Welcome to the Ranch.

You need to get the metadata for the row you are querying; obviously there is a DATETIME value which you are mistakenly trying to get INTs into or out of.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic