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
 
Without OCCURS CLAUSE can we select row

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
rambabu110
Warnings : 1

New User


Joined: 06 Feb 2006
Posts: 10
Location: Bangalore

PostPosted: Mon May 05, 2008 8:43 am    Post subject: Without OCCURS CLAUSE can we select row
Reply with quote

Hi,

1)On What base(means what situations)we go for Redefines clause? other than memory usage. icon_question.gif

2)without OCCURS CLAUSE can we select row by using Select Query many number of rows?On What base(means what situations)we go for Occurs clause?
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon May 05, 2008 8:53 am    Post subject:
Reply with quote

Hello,

1. redefines can be used for decomposition (i.e. to break down a date from x(8) to cc,yy,mm,dd) or when the same area has multiple definitions (i.e. a file with multiple record formats).

2. occurs has nothing to do with db2/cursors/select. etc. SQL prohibits "repeating groups" which is what occurs is used for.
Back to top
View user's profile Send private message
rambabu110
Warnings : 1

New User


Joined: 06 Feb 2006
Posts: 10
Location: Bangalore

PostPosted: Tue May 06, 2008 7:40 am    Post subject:
Reply with quote

2)without CURSORS can we select row by using Select Query many number of rows?On What base(means what situations)we go for Occurs clause?
Back to top
View user's profile Send private message
rambabu110
Warnings : 1

New User


Joined: 06 Feb 2006
Posts: 10
Location: Bangalore

PostPosted: Tue May 06, 2008 7:41 am    Post subject:
Reply with quote

rambabu110 wrote:
2)without CURSORS can we select row by using Select Query many number of rows?On What base(means what situations)we go for
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue May 06, 2008 7:47 am    Post subject:
Reply with quote

Hello,

If an embedded select (in a program) returns more than one row, it will raise an error.

If the result of your query (in a program) is more than one rows, you would use a cursor.

When using a cursor, you declare the cursor, open the cursor, and fetch rows until all have been processed.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Sat May 10, 2008 4:03 am    Post subject: Reply to: Without OCCURS CLAUSE can we select row
Reply with quote

ram,

you are confusing both OCCURS and CURSORS. read the manuals andpost if it is still not clear.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Date in where clause - Windows Karthikeyan Subbarayan DB2 9 Wed Nov 15, 2017 9:07 pm
No new posts Can we limit length in concatenation ... balaji81_k DB2 7 Tue Aug 22, 2017 2:50 am
No new posts Select numeric portion from CHAR data... balaji81_k DB2 6 Sat Aug 19, 2017 1:51 am
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts Two Selects in a single select query Rohit Umarjikar DB2 1 Fri Nov 04, 2016 8:46 pm

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