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

Without OCCURS CLAUSE can we select row


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Mon May 05, 2008 8:53 am
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
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
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

Moderator Emeritus


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

PostPosted: Tue May 06, 2008 7:47 am
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: 1287
Location: Chennai, India

PostPosted: Sat May 10, 2008 4:03 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Dynamically pass table name to a sele... DB2 2
No new posts SELECT from data change table DB2 5
No new posts Select two different counts from SQL... DB2 6
No new posts To search DB2 table based on Conditio... DB2 1
No new posts Select a DB2 value in a specific deci... DB2 4
Search our Forums:

Back to Top