how to check the table is empty or not?

Answers were Sorted based on User's Feedback



how to check the table is empty or not?..

Answer / vaneesh khurana

After executing the first query if you find SQLCODE = 100,
then the table is empty.

Is This Answer Correct ?    6 Yes 1 No

how to check the table is empty or not?..

Answer / sriram


EXEC-SQL
SELECT 1
INTO :X
FROM TAB1
END-EXEC
X is defined as s9(4) comp value zeroes
So, if there is a row in the table (i.e. the table is not
empty), 1 gets moved to variable X.
Did not have resources to run the query and validate ,



Please let me know if I am wrong

Is This Answer Correct ?    0 Yes 0 No

how to check the table is empty or not?..

Answer / sriram


EXEC-SQL
SELECT 1
INTO :X
FROM TAB1
END-EXEC
X is defined as s9(4) comp value zeroes
So, if there is a row in the table (i.e. the table is not
empty), 1 gets moved to variable X.
Did not have resources to run the query and validate ,



Please let me know if I am wrong

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More DB2 Interview Questions

wht steps we need will coding cobol and db2 pgm ?

6 Answers   CGI,


What is DCLGEN ?

3 Answers  


how to check the table is empty or not?

3 Answers   IBM,


What is host variable in db2 cobol?

0 Answers  


What is deadlock in db2?

0 Answers  


what happend with out using Commit,when closing cursor and program?

5 Answers   CSC,


Explain about rct in db2?

0 Answers  


how to delete perticular row from table for ex. how you will delete 3rd row from table please answer THANKS IN ADVANCE

10 Answers   IBM,


What is innodb buffer pool?

0 Answers  


wht are the restrictions for union ?

2 Answers   CTS,


List out the three types of page locks that can be held.

0 Answers  


What is the COBOL picture clause of the following DB2 data types: DATE, TIME, TIMESTAMP?

3 Answers  


Categories