SQL code -104 while executing a stored procedure



IBM's flagship relational database management system

SQL code -104 while executing a stored procedure

Postby upendra_water » Sat Oct 02, 2010 1:18 am

I am facing SQL code -104 while executing a stored procedure.
I have used a dynamic cursor and while preparing the cursor it is throwing SQLCODE -104.

Cursor is declared as follows:
EXEC SQL
DECLARE C1 ASENSITIVE SCROLL CURSOR
WITH ROWSET POSITIONING WITH HOLD FOR DYNAMQRY
END-EXEC.

Prepare statement:
EXEC SQL
PREPARE DYNAMQRY FROM :W600-RESULT-STRING
END-EXEC

Here W600-RESULT-STRING is defined as
01 W600-RESULT-STRING.
49 W600-RESULT-STRING-LEN PIC S9(04) COMP.
49 W600-RESULT-STRING-TXT PIC X(3000).

Can anyone please look into this? Please let me know if I need to furnish more information.
upendra_water
 
Posts: 33
Joined: Wed Nov 25, 2009 10:58 pm
Has thanked: 0 time
Been thanked: 0 time

Re: SQL code -104 while executing a stored procedure

Postby dick scherrer » Sat Oct 02, 2010 3:27 am

Hello,

Did you read about the -104?

http://publibz.boulder.ibm.com/cgi-bin/ ... 0/2.1.6.12

What does W600-RESULT-STRING-TXT CONTAIN?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: SQL code -104 while executing a stored procedure

Postby upendra_water » Sat Oct 02, 2010 4:04 am

Hi Dick,

Thank you so much for your quick response.
I read the information.

ILLEGAL SYMBOL "token". SOME SYMBOLS THAT MIGHT BE LEGAL ARE:
token-list

A syntax error was detected where the symbol "token" occurs in the SQL
statement. The list of symbols that might be legal shows some alternate
symbols that could possibly be correct at that point, if the preceding
part of the statement is entirely correct.

Can you please tell me what is "token" and token-list??

W600-RESULT-STRING-TXT contains SQL query.
For some reasons I will not be able to publish the query.
But just wanted to know if this error is because of syntax error while preparing the query?
upendra_water
 
Posts: 33
Joined: Wed Nov 25, 2009 10:58 pm
Has thanked: 0 time
Been thanked: 0 time

Re: SQL code -104 while executing a stored procedure

Postby dick scherrer » Sat Oct 02, 2010 5:44 am

Hello,

For some reasons I will not be able to publish the query.

Then it will be very difficult for anyone to help. Also, for what it is worth, the code to a query can be published - just change the "secret" values to something else. . . Keeping the code consistent.

But just wanted to know if this error is because of syntax error while preparing the query?
Yes, possibly.

Copy/paste the query into spufi or a batch job and see if it works.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post