473,385 Members | 1,343 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,385 software developers and data experts.

stored procedure not accepting data string more than 1024 bytes

I have a stored procedure running on DB2 V7 Z/os calling a COBOL
program to do some inserts. The stored procedure have 3 input columns
and one column is of varchar(32648)
The stored procedure is being called from a V7 DB2 connect client.

The stored procedure is giving SQL0104N An unexpected token was found
if my varchar data goes beyond 1024 bytes. Anything under 1025 bytes
on that column is working perfectly.
Does anybody know of any limitation of Stored procedure.

here is the stored procedure

CREATE PROCECURE CUSTOMSP
(
,IN CUSTOMER_NO CHAR(10)
,IN ORD_NO CHAR(8)
,IN ENCODED_DATA VARCHAR(32648)
,OUT WSRETURN INT
)
FENCED
LANGUAGE COBOL
EXTERNAL NAME 'CUSTOMSP'
NOT DETERMINISTIC
MODIFIES SQL DATA
NO DBINFO
COLLID CUSTOMR
NO WLM ENVIRONMENT
ASUTIME NO LIMIT
RESULT SETS 1
STAY RESIDENT NO
PROGRAM TYPE MAIN
SECURITY DB2
COMMIT ON RETURN NO

here is my call statement

CALL
CUSTOMSP('A123456789','12345678',000001ABCDEFGHIJ1 23456789012345678901234567890123456789012345678901 234567890123456789012345678901234567890000002ABCDE FGHIJ123456789012345678901234567890123456789012345 67890123456789012345678901234567890123456789Z00000 3ABCDEFGHIJ123456789012345678901234567890123456789 01234567890123456789012345678901234567890123456789 z000004ABCDEFGHIJ123456789012345678901234567890123 45678901234567890123456789012345678901234567890123 4567890000005ABCDEFGHIJ123456789012345678901234567 89012345678901234567890123456789012345678901234567 8901234567890000006ABCDEFGHIJ123456789012345678901 23456789012345678901234567890123456789012345678901 234567890123456789Z000007ABCDEFGHIJ123456789012345 67890123456789012345678901234567890123456789012345 678901234567890123456789z000008ABCDEFGHIJ123456789 01234567890123456789012345678901234567890123456789 0123456789012345678901234567890000009ABCDEFGHIJ123 45678901234567890123456789012345678901234567890123 4567890123456789012345678901234567890000010ABCDEFG HIJ12345678901234567890123456789012345678901234567 89012345',?);

Below is the message I am getting :
SQL0104N An unexpected token
"'000001ABCDEFGHIJ1234567890123456789012345678 90" was found following
","
Expected tokens may include: "<server-input-data>". SQLSTATE=42601
Any help is apprecaited

Thanks

Roger

Sep 6 '06 #1
2 2914

Roger wrote:
I have a stored procedure running on DB2 V7 Z/os calling a COBOL
program to do some inserts. The stored procedure have 3 input columns
and one column is of varchar(32648)
The stored procedure is being called from a V7 DB2 connect client.

The stored procedure is giving SQL0104N An unexpected token was found
if my varchar data goes beyond 1024 bytes. Anything under 1025 bytes
on that column is working perfectly.
Does anybody know of any limitation of Stored procedure.

here is the stored procedure

CREATE PROCECURE CUSTOMSP
(
,IN CUSTOMER_NO CHAR(10)
,IN ORD_NO CHAR(8)
,IN ENCODED_DATA VARCHAR(32648)
,OUT WSRETURN INT
)
FENCED
LANGUAGE COBOL
EXTERNAL NAME 'CUSTOMSP'
NOT DETERMINISTIC
MODIFIES SQL DATA
NO DBINFO
COLLID CUSTOMR
NO WLM ENVIRONMENT
ASUTIME NO LIMIT
RESULT SETS 1
STAY RESIDENT NO
PROGRAM TYPE MAIN
SECURITY DB2
COMMIT ON RETURN NO

here is my call statement

CALL
CUSTOMSP('A123456789','12345678',000001ABCDEFGHIJ1 23456789012345678901234567890123456789012345678901 234567890123456789012345678901234567890000002ABCDE FGHIJ123456789012345678901234567890123456789012345 67890123456789012345678901234567890123456789Z00000 3ABCDEFGHIJ123456789012345678901234567890123456789 01234567890123456789012345678901234567890123456789 z000004ABCDEFGHIJ123456789012345678901234567890123 45678901234567890123456789012345678901234567890123 4567890000005ABCDEFGHIJ123456789012345678901234567 89012345678901234567890123456789012345678901234567 8901234567890000006ABCDEFGHIJ123456789012345678901 23456789012345678901234567890123456789012345678901 234567890123456789Z000007ABCDEFGHIJ123456789012345 67890123456789012345678901234567890123456789012345 678901234567890123456789z000008ABCDEFGHIJ123456789 01234567890123456789012345678901234567890123456789 0123456789012345678901234567890000009ABCDEFGHIJ123 45678901234567890123456789012345678901234567890123 4567890123456789012345678901234567890000010ABCDEFG HIJ12345678901234567890123456789012345678901234567 89012345',?);

Below is the message I am getting :
SQL0104N An unexpected token
"'000001ABCDEFGHIJ1234567890123456789012345678 90" was found following
","
Expected tokens may include: "<server-input-data>". SQLSTATE=42601
Any help is apprecaited

Thanks

Roger

Please check your last parameter value its data type is varchar so valu
shoul be in single cote ( ' ' ) you have not open cote but close cote
please check it

Ritesh Kumar

Sep 7 '06 #2
good catch...but it was a "boo boo" from cut and paste. I have the
quotes correct and it still gives me an error.

Has anybody else encountered this error ?

Ritesh wrote:
Roger wrote:
I have a stored procedure running on DB2 V7 Z/os calling a COBOL
program to do some inserts. The stored procedure have 3 input columns
and one column is of varchar(32648)
The stored procedure is being called from a V7 DB2 connect client.

The stored procedure is giving SQL0104N An unexpected token was found
if my varchar data goes beyond 1024 bytes. Anything under 1025 bytes
on that column is working perfectly.
Does anybody know of any limitation of Stored procedure.

here is the stored procedure

CREATE PROCECURE CUSTOMSP
(
,IN CUSTOMER_NO CHAR(10)
,IN ORD_NO CHAR(8)
,IN ENCODED_DATA VARCHAR(32648)
,OUT WSRETURN INT
)
FENCED
LANGUAGE COBOL
EXTERNAL NAME 'CUSTOMSP'
NOT DETERMINISTIC
MODIFIES SQL DATA
NO DBINFO
COLLID CUSTOMR
NO WLM ENVIRONMENT
ASUTIME NO LIMIT
RESULT SETS 1
STAY RESIDENT NO
PROGRAM TYPE MAIN
SECURITY DB2
COMMIT ON RETURN NO

here is my call statement

CALL
CUSTOMSP('A123456789','12345678',000001ABCDEFGHIJ1 23456789012345678901234567890123456789012345678901 234567890123456789012345678901234567890000002ABCDE FGHIJ123456789012345678901234567890123456789012345 67890123456789012345678901234567890123456789Z00000 3ABCDEFGHIJ123456789012345678901234567890123456789 01234567890123456789012345678901234567890123456789 z000004ABCDEFGHIJ123456789012345678901234567890123 45678901234567890123456789012345678901234567890123 4567890000005ABCDEFGHIJ123456789012345678901234567 89012345678901234567890123456789012345678901234567 8901234567890000006ABCDEFGHIJ123456789012345678901 23456789012345678901234567890123456789012345678901 234567890123456789Z000007ABCDEFGHIJ123456789012345 67890123456789012345678901234567890123456789012345 678901234567890123456789z000008ABCDEFGHIJ123456789 01234567890123456789012345678901234567890123456789 0123456789012345678901234567890000009ABCDEFGHIJ123 45678901234567890123456789012345678901234567890123 4567890123456789012345678901234567890000010ABCDEFG HIJ12345678901234567890123456789012345678901234567 89012345',?);

Below is the message I am getting :
SQL0104N An unexpected token
"'000001ABCDEFGHIJ1234567890123456789012345678 90" was found following
","
Expected tokens may include: "<server-input-data>". SQLSTATE=42601
Any help is apprecaited

Thanks

Roger


Please check your last parameter value its data type is varchar so valu
shoul be in single cote ( ' ' ) you have not open cote but close cote
please check it

Ritesh Kumar
Sep 7 '06 #3

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

Similar topics

4
by: Thomas Paul Diffenbach | last post by:
Can anyone point me to an open source library of /statically allocated/ data structures? I'm writing some code that would benefit from trees, preferably self balancing, but on an embedded system...
2
by: Dino L. | last post by:
How can I run stored procedure (MSSQL) ?
3
by: Jack Black | last post by:
Help!! I'm trying to call a custom stored procedure from a VB.Net code-behind page in an ASP.Net application, and I keep getting an error with no real helpful info... Basically, I'm accepting a...
4
by: hicks | last post by:
I'm trying to invoke a DB2 stored procedure. The stored proc is coded in C and compiled to a shared library, which has been placed in the <DB2 dir>/functions directory. The platform is Solaris....
0
by: Roger | last post by:
have a stored procedure running on DB2 V7 Z/os calling a COBOL program to do some inserts. The stored procedure have 3 input columns and one column is of varchar(32648) The stored procedure is...
4
by: nishi57 | last post by:
I hope I can get some help regarding this issue, which has been going on for a while. I have a desktop user who is having problem running "Stored Procedures". The DB2 Connect application works fine...
0
by: ravindrag | last post by:
Hi, I am getting error SQL1131N during sqlj.install_jar(...). There is no useful message in the diag.log (even with diag level 4). I am giving the diag.log entries at the end of this posting...
0
by: db2user24 | last post by:
I'm trying to invoke a DB2 stored procedure. The stored proc is coded in C and compiled to a shared library, which has been placed in the <DB2 dir>/functions directory. The platform is Linux (using...
4
by: Veeraraghavan | last post by:
Hi All, I am developing a client server communication using system.net.socket and I am finding it very difficult to get a solution for this. I started with single port communication with single...
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...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.