Chapter 3 Troubleshooting


Stored procedure errors

This section addresses problems that may arise when you are trying to use jConnect and stored procedures.

RPC returns fewer output parameters than registered

SQLState: JZ0SG - An RPC did  not return as many output parameters as the application had registered  for it.

This error occurs if you call CallableStatement.registerOutParam( ) for more parameters than you have declared as "OUTPUT" parameters in the stored procedure. Make sure that you have declared all of the appropriate parameters as "OUTPUT." Look at the line of code that reads:

 create  procedure yourproc (@p1 int OUTPUT, ...

Note   If you receive this error while using Adaptive Server Anywhere (previously known as SQL Anywhere), upgrade to Adaptive Server Anywhere version 5.5.04 or later.

Fetch/state error when stored procedure returns output params

If a query does not return row data, then it should use the CallableStatement.executeUpdate( ) or execute( ) methods rather than the executeQuery( ) method.

As required by the JDBC standards, jConnect throws a SQL exception if an executeQuery( ) has no result sets.

Stored procedure executed in unchained transaction mode

Sybase Error 7713 - Stored Procedure  can only be executed in unchained transaction mode.

JDBC attempts to put the connection in autocommit(true) mode. The application can change the connection to chained mode using Connection.setAutoCommit(false) or by using a "set chained on" language command. This error occurs if the stored procedure was not created in a compatible mode.

To fix the problem, use:

sp_procxmode procedure_name,"anymode"

 


Copyright © 2001 Sybase, Inc. All rights reserved.