Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
DB2- rowset positioning cursor issue

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: DB2- rowset positioning cursor issue
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    Post subject: Reply to: DB2- rowset positioning cursor issue
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Tape file issue abdulrafi JCL & VSAM 2 Thu Feb 08, 2018 12:01 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts -502 Error - Cursor already open anand jeyapaul DB2 7 Sun Oct 29, 2017 4:22 am
No new posts SIGNAL ON HALT issue packerm CLIST & REXX 1 Fri Oct 20, 2017 6:56 pm
No new posts Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us