473,320 Members | 1,936 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Client application calling Stored Procedure...

The following is a piece of code from my client application which is
trying to call stored procedure SP1:

String callstmt = "CALL DB2ADMIN.SP1(?,?,?)";
CallableStatement clst1 = conn.prepareCall(callstmt);
String e = "000150";
clst1.setString(1,e);

" clst1.setString(1,e);" fails with exception CLI0109E String data
right truncation.

Why is it not allowing it to be set to "000150"? If I change the
above to:

String callstmt = "CALL DB2ADMIN.SP1(?,?,?)";
CallableStatement clst1 = conn.prepareCall(callstmt);
String e = "5";
clst1.setString(1,e);

The program runs fine. Why is it allowing me to only code a single
character and not a string of characters.

Regards,
Raquel.
Nov 12 '05 #1
2 1676
ra****************@yahoo.com (Raquel) wrote in message news:<9a**************************@posting.google. com>...
The following is a piece of code from my client application which is
trying to call stored procedure SP1:

String callstmt = "CALL DB2ADMIN.SP1(?,?,?)";
CallableStatement clst1 = conn.prepareCall(callstmt);
String e = "000150";
clst1.setString(1,e);

" clst1.setString(1,e);" fails with exception CLI0109E String data
right truncation.

Why is it not allowing it to be set to "000150"? If I change the
above to:

String callstmt = "CALL DB2ADMIN.SP1(?,?,?)";
CallableStatement clst1 = conn.prepareCall(callstmt);
String e = "5";
clst1.setString(1,e);

The program runs fine. Why is it allowing me to only code a single
character and not a string of characters.

Regards,
Raquel.


Check the define of you J-SP, the first input argument maybe a char(1)
Richard.
Nov 12 '05 #2
It indeed is the problem Richard. Thanks.

Regards,
Raquel.
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: dw | last post by:
Hello all, I'm having a dickens of a time calling a stored procedure on a connection. Every time I do, it generates an error "Arguments are of the wrong type, are out of acceptable range, or are in...
4
by: Paul | last post by:
Hi, In SQL Books Online in the section on @@Error it gives the following example: -- Execute the INSERT statement. INSERT INTO authors (au_id, au_lname, au_fname, phone, address, city,...
1
by: Lauren Quantrell | last post by:
I'm using an Access2K front end on a SQL Server2K backend. I use Scope_Identity() in a lot of stored procedures to pass the newwly inserted record's unique ID to the next select statement in the...
1
by: Anthony Robinson | last post by:
I'm executing a stored procedure and getting the SQL0440N No authorized routine named "AMROBI2.CREATEAIMCONNECTION" of type "PROCEDURE " having compatible arguments was found. The schema...
2
by: Rhino | last post by:
I am trying to verify that I correctly understand something I saw in the DB2 Information Center. I am running DB2 Personal Edition V8.2.1 on Windows. I came across the following in the Info...
2
by: Woody Splawn | last post by:
I am using SQL Server 2000 as the back-end. I have created a stored procedure in SQL server called usp_AddContract. This Stored procedure inserts a new contract into a contracts table. I have...
2
by: singlal | last post by:
Hi, my question was not getting any attention because it moved to 2nd page; so posting it again. Sorry for any inconvenience but I need to get it resolved fast. Need your help! ...
5
by: Sridhar | last post by:
Hi, I have created a web application. I have a data access dll to interact with database. I added this dll as a reference to the web application. Now let's say if I am calling a function in data...
3
by: mgsmario | last post by:
Hi Guys I have an ASP application that connects to an Oracle database, right now I'm trying to connect this same ASP application to a DB2 database (Express-C, version 9.5.0). I'm in the process...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.