wood burning stoves 2.0*
The moose likes JDBC and the fly likes Invalid parameter binding(s). Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Invalid parameter binding(s)." Watch "Invalid parameter binding(s)." New topic

Invalid parameter binding(s).

Ameya Thakur
Ranch Hand

Joined: Feb 04, 2004
Posts: 43
Hi !!!
I am wrting a small store Proc for inserting an value and fetching the Id for the value inserted.

i.e I have Id as an identity column (auto incremented) so i wanted to know the ID for which i am doing the insert operation.

My Store Proc goes like this

CREATE PROCEDURE dbo.spInsertStackTrace
@StackTraceLog as varchar (4000),
@StackTest as varchar (50),
@StackTraceId as int output
Insert Into StackTrace(StackTraceLog,StackTest)
Select @StackTraceId = MAX(StackTraceId) from StackTrace



Persistor myPersistor = PersistorFactory.createPersistor("ccmaster");
CallableStatement cstmt = null;
cstmt = myPersistor.prepareCall("{call spInsertStackTrace(?,?,?)}");
int stackTraceId = cstmt.getInt(3);
System.err.println("Stack Trace Id"+stackTraceId);

with the above code i am getting the following error..

java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Invalid parameter binding(s).

It looks pretty simple i am just not able to figure how to register the out parameter..so would some one help me and update me that would be very very great.

Thanks a lot
I agree. Here's the link: http://aspose.com/file-tools
subject: Invalid parameter binding(s).
Similar Threads
what is the equivalent data type for Oracle Cursor.
Calling COBOL stored proc from Java Servlet
How to search record on (firstname+lastname) or (lastname+firstname)? please help me
Are there any constraints on length of String?
Retrieving the output parameter from the CallableStatement