IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SQL Code -104 when calling the cursor second time


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
C_Kartika_C
Warnings : 1

New User


Joined: 14 Jun 2006
Posts: 3

PostPosted: Tue Jan 16, 2007 9:22 am
Reply with quote

I have a service that is working fine when called for the first time from a calling programs. But when a call is made to it for the second time, it is returning -104 as SQL Code for thr first Cursor.
The cursor was properly closed but still returning the same error.
Thanks in advance
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Tue Jan 16, 2007 10:17 am
Reply with quote

Did you mean a cursor when fetched in a called program and opened in a calling program works fine for the first time, but gives SQL -104 for the second time.

Please post cursor declaration:-
Back to top
View user's profile Send private message
C_Kartika_C
Warnings : 1

New User


Joined: 14 Jun 2006
Posts: 3

PostPosted: Wed Jan 17, 2007 6:57 am
Reply with quote

the cursor is opened, fetched and closed in second program only.
Just the program is called by another calling program.
For first call, everything went fine, after the second call is made, when control goes to called program, at the open of first cursor -104 is returned.
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Wed Jan 17, 2007 7:59 am
Reply with quote

C_Kartika_C,

I don't see any reason that the cursor shouldn't be able to be opened/cloded multiple times. Is it possible that you may be corrupting storage the first pass through?
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Wed Jan 17, 2007 8:05 am
Reply with quote

SQL -104 is a syntax error problem... here is some details about -104 from abend assist...

Reason:-
ILLEGAL SYMBOL token VALID SYMBOLS ARE token-list
Description of -104:-A syntax error in the SQL statement was detected at 'token'.A partial list of valid tokens, 'token-list', is provided. This list assumes that the statement is correct up to that point, and only as many tokens are listed as will fit.
Response:-Examine the statement in the area of the specified token.If you are executing the SQL statement dynamically under TSO, be sure that if the data set containing the DSNHDECP load module has not been included in your LINKLSTxx, it has been included in STEPLIB statements in:1. The DB2 start-up procedure 2. The TSO logon procedure or batch job JCL.
Quote:
when control goes to called program, at the open of first cursor -104 is returned.

Can you post your cursor declaration... and code...
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts Calling Java method from batch COBOL ... COBOL Programming 5
Search our Forums:

Back to Top