aspose file tools*
The moose likes JDBC and the fly likes Sybase SP error - Operand type clash: INT is incompatible with DATETIME Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Sybase SP error - Operand type clash: INT is incompatible with DATETIME" Watch "Sybase SP error - Operand type clash: INT is incompatible with DATETIME" New topic
Author

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

Raj Aryan
Greenhorn

Joined: Apr 18, 2007
Posts: 7
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

Joined: Oct 13, 2005
Posts: 36486
    
  16
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.
 
Consider Paul's rocket mass heater.
 
subject: Sybase SP error - Operand type clash: INT is incompatible with DATETIME
 
Similar Threads
I am trying to use jdbc to call sp procedure in UDB 8.1
Clash of Civilizations!!
Mapping clash for ServletWrapper
Problems with Callable Statement in Sybase
Exception calling Stored Procedure