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

How can you display the current date & current time ?

7 Answers   Cap Gemini,


What is a DB2 bind?

1 Answers   Logica CMG,


Why do chiropractors use drop table?

0 Answers  


How do you do the EXPLAIN of a dynamic SQL statement?

2 Answers  


How many clustering indexes can be defined for a table?

2 Answers  






What do the initials DDL and DML stand for and what is their meaning?

2 Answers  


Why do we need reorg in db2?

0 Answers  


What is plan in cobol db2?

0 Answers  


What is a Resource Control Table(RCT)? Describe its characteristics.

3 Answers  


The only place of VSAM KSDS in DB2 is?

2 Answers   IBM,


what is the soft code for deadlock ?

2 Answers   Logica CMG,


How do I import a csv file into db2?

0 Answers  


Categories