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

Explain about dbrm.

801


How do you concatenate the firstname and lastname from emp table to give a complete name?

820


What is deadlock in db2?

826


Can we insert update delete in view?

767


How will you return the number of records in table?

719


Give the name of some fields form sqlca.

841


What is reorg?

859


Define sqlca.

862


What is innodb buffer pool?

771


What os does db2 run on?

760


What is cursor in dbms?

845


What is difference between isnull and coalesce?

822


What is clone table?

809


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

467


What's The Percentage Free Space ?

981