Select empno, sal from emptbl where empno < 101.By this
query can we fetch first 100 recs? where empno is primary
key.It won't throw -811 error? if it wont,then what is use
of cursor technique while fetching first 100 recs.


Please need more clarification.

Answers were Sorted based on User's Feedback



Select empno, sal from emptbl where empno < 101.By this query can we fetch first 100 recs? wh..

Answer / kingmanish

Yes this query will fetch multiple records.

If tried to fetch these records in variables in a sql query
it will give -811 error.

In order to be able to handle these multiple records we
have to use cursor.

Now using cursor we can process each of these records one
at a time and thus cursors come handu here.

Is This Answer Correct ?    6 Yes 0 No

Select empno, sal from emptbl where empno < 101.By this query can we fetch first 100 recs? wh..

Answer / madhu t

If the to fetch empno and sal from emptble is written in
embedded sql then it will give sqlcode -811.
yes this query fetches first 100 records of employee table.

Is This Answer Correct ?    3 Yes 1 No

Post New Answer

More DB2 Interview Questions

What is a predicate?

1 Answers  


What is difference between rollback and commit?

0 Answers  


What is the purpose of the WHENEVER statement?

1 Answers  


What is the physical storage length of each of the following DB2 data types: DATE, TIME, TIMESTAMP?

1 Answers   CTS,


Which component is responsible for db2 startup and shutdown?

0 Answers  






How can we read records for specific member in CL? AND rpg?

0 Answers  


what is commit & rollback? When and where is used while compiling a cobol-db2 program?

2 Answers  


i know the stpes 2 create an executable CICS/DB2 cobol code. 1. DB2 Precompiler converts the SQL Statements into COBOL API statements and creates another member with Acess plans. CodeA results in CodeB (code with API calls) & CodeC ( Access Plans ) 2.Code B is compiled/linked 2 create an exceutable.(codeE) 3.Now CodeC is binded to the database on which CodeE will be run. Can somebody provide me the sample JCLs for precompile/compile/link/bind.

0 Answers  


why we go for SPUFI for creating tables or for sql queries?

4 Answers  


What is a synonym? How is it used?

2 Answers  


In case if at some point of time db2 is down, would that impact the pre-compilation process of a db2-cobol program?

0 Answers  


What are the different methods of accessing db2 from tso? How is the connection established between TSO & DB2?

3 Answers   Tech Mahindra,


Categories