what happens if we dont close cursor in db2-cobol pgm?

Answers were Sorted based on User's Feedback



what happens if we dont close cursor in db2-cobol pgm?..

Answer / vaid

i think, if we dont close a cursor there will be no problem.

since once the program ends all the database
transaciton/connections are terminated and also commit is
implicitly executed.. so the cursors will be closed.

and all resources held by program will be released.

Is This Answer Correct ?    12 Yes 1 No

what happens if we dont close cursor in db2-cobol pgm?..

Answer / manju

When the COMMIT stmt is issued, the cursor is atomatically
closed.

Is This Answer Correct ?    11 Yes 2 No

what happens if we dont close cursor in db2-cobol pgm?..

Answer / i go crazy

If the cursor is declared WITH HOLD option, then after committing cursor will not close. Otherwise cursor will close automatically after committing or after the end of the program.

Is This Answer Correct ?    8 Yes 0 No

what happens if we dont close cursor in db2-cobol pgm?..

Answer / swamy

If you dont close cursor in your db2-cobol program, the
program will effectively have a hold on the tablebase and will
prevent other users from acessing it or updating it. Correct
me if i am wrong

Is This Answer Correct ?    6 Yes 5 No

what happens if we dont close cursor in db2-cobol pgm?..

Answer / karthic

If the cursor has not been closed, the cursor will occupy
the whole private SQL work area. The next query performance
will be affected.

Is This Answer Correct ?    3 Yes 2 No

what happens if we dont close cursor in db2-cobol pgm?..

Answer / vinodquestion

I am not confident about this answer::

I think no problem when u not close cursor. But problem occurs when you again OPEN CURSOR.

When this happen some cursor related errors occurs. I think 502 will show. I Dont know exactly.

Please Correct My answer if it is wrong.

Is This Answer Correct ?    2 Yes 5 No

Post New Answer

More COBOL Interview Questions

I have one column say 'X' defined as VARCHAR Can anyone tell me What are the different ways to update this column thru COBOL-DB2 program?

5 Answers  


COBOL Snippet: Tell where the control will when the below code execute IF (A=B) CONTINUE ELSE NEXT SENTENCE PERFORM <IMP-STMT> END-IF.

7 Answers   HCL,


What is binary search?

3 Answers  


Can anyone tell me how to handle the array beyond the limit. If we have an array or a table which can handle 5000 records but now we have to compensate 20000 records with the same array? how to handle the situation.

2 Answers  


what is mainframe? what is the mainframe software ? what is use in s/w field?

7 Answers   CSE,






without performing any operations on a file how can i know whether it contains data or not

2 Answers  


if i am reading a file with some 50000 records and moving to a DB2 table and suddenly the program abends in between, is there anyway i could restart from the exact record at which the job failed once the program restarts.

2 Answers   UST,


What will happen if a variable is declared as below.. Explain with an example? Working storage section:- 01 WS-VARX PIC X(10) VALUE 'ABCDEFGHIJ'. 01 WS-VARN REDEFINES WS-VARX PIC 9(5) VALUE '12345'. What will happen I want Display WS-VARX and WS-VARN?

3 Answers   Xansa,


What is an in-line perform ?

4 Answers   Accenture,


TYPES OF SORTINGS. which is more prefarable.

2 Answers   Syntel, TCS,


how to transfer the file from pc to mainframe??

3 Answers  


how can u pass the values into db2 values from cobol ?

3 Answers   CTS,


Categories