By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,693 Members | 1,264 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,693 IT Pros & Developers. It's quick & easy.

stored procedure not accepting data string more than 1024 bytes

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a

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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.