CURSOR

Ask question on - DataBase Concepts, IBM Mainframe DB2, DB2/UDB, DB2 Tools, SQL , DB2 programming with languages like COBOL, PL1.

Moderators: Kalicharan, Moderator Group

Post Reply
User avatar
ibmlearner
Member
Posts: 13
Joined: Sat Dec 02, 2006 5:57 pm

CURSOR

Post by ibmlearner » Thu Mar 08, 2007 8:15 pm

HI ALL ,,

USING CURSOR HOW TO FETCH SPECIFIC RECORDS ??

SAY THERE ARE 500 RECORDS.

NEED ONLY 201 TO 300 RECORDS

TIA.
Thanks & Regards
-------------------------
Learner

Veera
Moderator
Posts: 111
Joined: Wed Feb 22, 2006 2:59 pm

Post by Veera » Sat Mar 10, 2007 12:14 am

It should be possible using the where clause where row_num between A and B.
Where u can specify values for A and B.

select {column list}
from (select {column list}, row_number() over() as
row_num from table) x where row_num between A and B.

As i said earlier i donot have DB2 in my curr proj to run a quick test and confirm u the results, try this i fit doesn work let us know we will figure out more on this.

Thanks,
Veea

User avatar
Sheela
Member
Posts: 14
Joined: Mon Feb 26, 2007 8:17 am
Location: Chennai

DB2 - FETCH FIRST N RECORDS ONLY

Post by Sheela » Sat Mar 10, 2007 7:38 am

I dont have exact answer for your question.

But here is some useful information,

FETCH FIRST 100 RECORDS ONLY

it will be first 100 records from the cursor.
Regards,
Sheela

academyindia4

Topic deleted by Admin

Post by academyindia4 » Fri Jan 15, 2016 9:09 pm

<< Content deleted By Admin >>

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others