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

DB2- rowset positioning cursor issue


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

New User


Joined: 08 Aug 2008
Posts: 9
Location: Kolkata

PostPosted: Mon Mar 16, 2009 2:16 pm
Reply with quote

We have defined a rowset cursor and trying to fetch the rowset cursor, but facing issue in pre-compile.

Code:

Declaration:

DECLARE CURSOR3 CURSOR

WITH ROWSET POSITIONING

FOR

SELECT a, b, c, d

FROM TableA

WHERE Z = 'MKT'

AND STAT = 'ACTIVE'

AND T_EFF_X ¬> :WS-CURRENT-TS

AND (T_END_X ¬< :WS-CURRENT-TS

OR T_END_X IS NULL)

END-EXEC.

Fetch:
EXEC SQL

FETCH ROWSET FROM CURSOR3

FOR 1000 ROWS

INTO :WS1-A ,

:WS1-B ,

:WS1-C ,

:WS1-D


END-EXEC

Error:

DB2 SQL PRECOMPILER MESSAGES
DSNH104I E DSNHSM3 LINE 8320 COL 33 ILLEGAL SYMBOL "FROM". SOME SYMBOLS THAT MIGHT BE LEGAL ARE: STARTING
DSNH104I E DSNHSM3 LINE 8320 COL 38 ILLEGAL SYMBOL "CURSOR3".SOME SYMBOLS THAT MIGHT BE LEGAL ARE: AT

Please let me know if you know what the issue may be. I don't want to make this a scrollable cursor. I just want to do multi-fetch.
Back to top
View user's profile Send private message
Succor

New User


Joined: 20 Feb 2009
Posts: 96
Location: Bangalore :)

PostPosted: Mon Mar 16, 2009 3:12 pm
Reply with quote

Santsark,Try
Code:
FETCH NEXT ROWSET FROM CURSOR3
inplace of
Code:
FETCH ROWSET FROM CURSOR3


WTF
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 SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
No new posts Facing ABM3 issue! CICS 3
No new posts Panvalet - 9 Character name - Issue c... CA Products 6
No new posts Issue with EXEC CICS QUERY SECURITY c... CICS 6
Search our Forums:

Back to Top