When is the results table for the query in a DECLARE CURSOR
statement created?
Answers were Sorted based on User's Feedback
Answer / biswamoy
You can Declare Cursor either in Working-storage section or
in Procedure division. It is not executable
OPEN CURSOR is executable ( here it creates Result), Fetch
rows within loop then close cursor.
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / shailendra
cursor
declare cursor : it is not exectable statement it take
place in working storage section,it just keep the cursor
on that place where the condition is satisfied which is
define in the quary.
executable statement define in procedure division:
1> open cursor : it define now which cursor open to retrive
data, we can define many cursor at a time.
2> fetch cursor:this statement fetch the record which is
satisfy the condition
3> close cursor : it close the cursor
now if we want to fetch the same record again then it must
to go through open cursor statement again.
Is This Answer Correct ? | 2 Yes | 3 No |
Answer / mani
the first one is correct i.e. when the open cursor statement
gets executed, the results table is created for the query in
declare cursor statement.
after that when fetch is done it is actually retrieved one
by one from the results table.
Is This Answer Correct ? | 1 Yes | 2 No |
Answer / mehdee
It is not OPEN CURSOR is executed, it is the 1st FETCH.
Is This Answer Correct ? | 0 Yes | 1 No |
Comment whether dclgen is mandatorily used. If not, then what is the point of using it?
Explain db2.
What is the use of COMMAREA ?Minimum how much data we can pass from it?
how do we solve soc 7 and soc4 ?
what is the use of commit ? and what is the syntax?
What does the RUNSTATS Utility do?
What is referential integrity?
What is bind in db2?
if suppose i am having an ACCOUNT table with 3 coloumns ACC. NO,ACC. NAME,ACC. AMOUNT . If a unique index is also defined on ACC.NO and ACC.NAME then write a query to retrieve account holders records who have more than 1 ACC.
What is an alias?
What is cursor with hold option in db2?
if any of the column names is provided wrong, where do you get the error(during precompilation or during Bind)