what is the diff b/w select stsmt and cursor ?
Answers were Sorted based on User's Feedback
Answer / vinodquestion
Select stmt--> This is DML stmt in sql. With this we can retrieve rows or complete tables from database.
But here in cobol-db2 prog in embededd sql statements it uses. for retrieving rows from tables.
Using this we should retreive only single row from table.(i.e, at where clause)
Cursor stmt--> IF you want to retreive more than one row u need to use this cursors concepts.
IF MY ANSWER IS WRONG CORRECT MY ANSWER>>
Note: Select stmt also used in file accesing situations. i.e, (select file assign to dd1.)
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / smartboy
SELECT is SQL query to retrive rows from table in
relational database.
The COBOL program uses the embedded SQL, In order to
process multiple rows in cobol program CURSOR is used.
CURSOR is basically a contolled structure/ mechanisum by
which we can process the multiple data rows in host
language program.
If you observe the syntax of CURSOR it uses the SELECT
query inside it.
| Is This Answer Correct ? | 2 Yes | 0 No |
I have a variable account-number declared as comp-3, s9(10) comp-3 in a file. How do i find a particular account number say 123456 in that file?
consider the following piece of code 01 GROSS-PAY 05 BASIC-PAY PIC 9(5) 05 ALLOWENCES PIC 9(3) if BASIC-PAY has a value 1000 and ALLOWENCES has a value of 250,what will be displayed by the statement DISPLAY GROSS-PAY a.1250 b.01000250 c.01250 d.1.250
How to code fscode 10 in cobol program? Where yoy code in your pgm?give ans for the question.
How can I find the maximum value of a field in a file while reading the file dynamically? without using sort function. Suppose i have a file with fields Timestamp, description, teamname, teamnumber.. i have read the file till end and find the maximun value of timestamp which is not in sorted order.. can we use function max(timestamp)?
what is the difference between Normal vaiable and comp variable.
How do you compile cobol program..?
Identify the invalid dataname from the following: (A) savings-account (B) annual-allocation-for-overhead (C) samount250 (D) 12demand
What COBOL construct is the COBOL II EVALUATE meant to replace?
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 am going to Display the WS-VARX and WS- VARN?
What is the LINKAGE SECTION used for?
When can the USING phrase be included in the call statement ?
I HAVE FOLLOWING DECLARATION. 02. A PIC X(10) VALUE 'XXXXXXXXXX'. 02. B REDEFINES A. 05. C PIC X(3). 05. D PIC X(3). 05. E PIC 9(3). IN MY PROG, I HAVE MOVE 1 TO E. DISPLAY A. WHAT WILL BE DISPLAYED AS A RESULT OF THIS? PLEASE EXPLAIN THE ANSWER. THANKS.