RE: Error converting data type varchar to int



I should clarify that I ran the store procedure in SQL Query Analyzer and it
works as design. Addtionally, the java code is straightforward, so I am left
to believe the JDBC Driver has an issue.

Thanks for reading my post.

Russ

"Russ_from_Alabama" wrote:

I have a problem with getting the error code from the callable statement.

I declare position 14 in the callable statement as an INTEGER for the error
code. The store procedure runs and comes back, but I receive this error when
I try to access the data:


[7/24/06 13:01:17:906 CDT] 7d7d00a2 SystemErr R java.sql.SQLException:
[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Error converting data
type varchar to int.
[7/24/06 13:01:17:906 CDT] 7d7d00a2 SystemErr R at
com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
[7/24/06 13:01:17:906 CDT] 7d7d00a2 SystemErr R at
com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
[7/24/06 13:01:17:906 CDT] 7d7d00a2 SystemErr R at
com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
[7/24/06 13:01:17:906 CDT] 7d7d00a2 SystemErr R at
com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
[7/24/06 13:01:17:906 CDT] 7d7d00a2 SystemErr R at
com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown
Source)
[7/24/06 13:01:17:906 CDT] 7d7d00a2 SystemErr R at
com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
[7/24/06 13:01:17:906 CDT] 7d7d00a2 SystemErr R at
com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown
Source)
[7/24/06 13:01:17:906 CDT] 7d7d00a2 SystemErr R at
com.microsoft.jdbc.base.BaseStatement.getNextResultType(Unknown Source)
[7/24/06 13:01:17:906 CDT] 7d7d00a2 SystemErr R at
com.microsoft.jdbc.base.BaseCallableStatement.getAndValidateOutParameter(Unknown Source)
[7/24/06 13:01:17:906 CDT] 7d7d00a2 SystemErr R at
com.microsoft.jdbc.base.BaseCallableStatement.getString(Unknown Source)
[7/24/06 13:01:17:906 CDT] 7d7d00a2 SystemErr R at
com.microsoft.jdbcx.base.BaseCallableStatementWrapper.getString(Unknown
Source)

Here is the source code for setting up the CallableStatement. All the other
parameters are Strings or floats.



call.registerOutParameter(14, java.sql.Types.INTEGER);

/*Executing SP*/
call.execute();



/*Check ErroCode*/
checkDBErrorCode(
fails here >>>>>>>>> call.getInt(14),
"<firstFail>"
+ call.getString(12)
+ "</firstFail> - "
+ call.getString(13),
CLASS_NAME,methodName);





The Store Procedure inputs looks like this:



CREATE PROCEDURE BatchQuickProcess
@p_taskids VARCHAR(600),
@p_qpstatus VARCHAR(1),
@p_qpreviewoper CHAR(8),
@p_actdesc CHAR(10),
@p_dptdesc CHAR(10),
@p_tskdesc CHAR(10),
@p_table VARCHAR(1),
@p_defaultwd FLOAT,
@p_defaultwt FLOAT,
@p_wrkbskt VARCHAR(8),
@p_operid VARCHAR(8),
@p_curtskid VARCHAR(11) OUTPUT,
@p_reterror VARCHAR(255) OUTPUT,
@p_retcode INT OUTPUT,
@p_commit CHAR(1) = 'Y'



I am using SQL Server 2000 with JDBC Drivers
Version 2.2.0040, Service Pack 3

Any help or insight would be greatly appreciated.
.



Relevant Pages

  • Error converting data type varchar to int
    ... I have a problem with getting the error code from the callable statement. ... The Store Procedure inputs looks like this: ... @p_defaultwd FLOAT, ... @p_retcode INT OUTPUT, ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Re: Select, store procedure question?
    ... There are several ways you can check for a Null value in your procedure using SQL, but this is probably what your after: ... > I have a store procedure like this: ... > @id int OUTPUT ... Prev by Date: ...
    (microsoft.public.dotnet.languages.csharp)
  • Select, store procedure question?
    ... I have a store procedure like this: ... @p2 datetime ... @id int OUTPUT ... Prev by Date: ...
    (microsoft.public.dotnet.languages.csharp)
  • How to use output parameters in store procedure?
    ... I want to learn store procedure but I still do not know how to use output ... create proc ytd_sales ... @title varchar, @ytd_sales int output ... from titles ...
    (microsoft.public.sqlserver.server)

Loading