how to check the table is empty or not?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Why select is not preferred in embedded sql programs?

995


before altering a table is it necessary to lock ? if lock what is it ? how to do ? ifi want to lock a table what is that command ?

1957


What is release/acquire in bind?

900


What is a cursor in programming?

865


Mention the location where the output received from explain statement is stored.

901


What is the difference between using bind () and rebind () methods of naming class?

1124


What is the advantage in De-normalizing tables in DB2?

978


How to retrieve rows from a db2 table in embedded sql?

1047


What is iseries database?

842


What is buffer pool and list some of them?

837


Hi Everyone... Under the Logical files, when am working on multiple rec format logical file, I have joined two pf's using the multiple record format logical file concept, but when i run queried the LF only the first mentioned pf records are reflecting and I am not able to see any of the field records specified under the second pf. Kindly let me know whats the reason behind this. Below is the str of LF., R rec PFILE(LOGICAA) CUSTNO CUSTNAME BILL K CUSTNO R rec1 PFILE(LOGICAA1) CUSTNO ADD K CUSTNO .....

2152


What is null value in db2?

799


How would the varchar column remarks defined?

878


My sql statement select avg(salary) from emp yields inaccurate results. Why?

893


How to check table size in db2 sap?

818