View previous topic :: View next topic
|
Author |
Message |
rambabu110 Warnings : 1 New User
Joined: 06 Feb 2006 Posts: 10 Location: Bangalore
|
|
|
|
Hi,
1)On What base(means what situations)we go for Redefines clause? other than memory usage.
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
rambabu110 Warnings : 1 New User
Joined: 06 Feb 2006 Posts: 10 Location: Bangalore
|
|
|
|
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 |
|
|
rambabu110 Warnings : 1 New User
Joined: 06 Feb 2006 Posts: 10 Location: Bangalore
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
ram,
you are confusing both OCCURS and CURSORS. read the manuals andpost if it is still not clear. |
|
Back to top |
|
|
|