When is the results table for the query in a DECLARE CURSOR
statement created?

Answers were Sorted based on User's Feedback



When is the results table for the query in a DECLARE CURSOR statement created?..

Answer / s

When OPEN CURSOR is executed

Is This Answer Correct ?    4 Yes 1 No

When is the results table for the query in a DECLARE CURSOR statement created?..

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

When is the results table for the query in a DECLARE CURSOR statement created?..

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

When is the results table for the query in a DECLARE CURSOR statement created?..

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

When is the results table for the query in a DECLARE CURSOR statement created?..

Answer / mehdee

It is not OPEN CURSOR is executed, it is the 1st FETCH.

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More DB2 Interview Questions

List out the buffer pools in db2

0 Answers  


Explain an outer join?

1 Answers  


quary for 1> fetch last record 2> fetch in reverse order 3> fetch last 5 row 4> fetch second last record (their is no primary key) i think concept of count can be use for this in 4th

5 Answers  


i have an employment table whch has salary,dept,name? i want salary b/w 1000 to 5000 can anyone pls say the query for ths ?

8 Answers   Cap Gemini, CGI, EDS, IBM, Satyam, Wipro,


What information is contained in a SYSCOPY entry?

2 Answers  


What happens to a cursor after a commit?

3 Answers  


How can you compare table column after update and before update?

5 Answers   Satyam,


What is check constraint in db2?

0 Answers  


Is db2 a mainframe database?

0 Answers  


how to identify the pseudo conversation by seeing the program

2 Answers   DELL,


how to fetch multiple records without using cursor

14 Answers   HCL,


What is the format (internal layout) of ?TIMESTAMP??

1 Answers  


Categories