• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error converting data type varchar to int.

 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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_taskidsVARCHAR(600),
@p_qpstatusVARCHAR(1),
@p_qpreviewoperCHAR(8),
@p_actdescCHAR(10),
@p_dptdescCHAR(10),
@p_tskdescCHAR(10),
@p_tableVARCHAR(1),
@p_defaultwdFLOAT,
@p_defaultwtFLOAT,
@p_wrkbsktVARCHAR(8),
@p_operidVARCHAR(8),
@p_curtskidVARCHAR(11) OUTPUT,
@p_reterrorVARCHAR(255) OUTPUT,
@p_retcodeINT 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.
 
Tick check! Okay, I guess that was just an itch. Oh wait! Just a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic