how to check the table is empty or not?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
What is the difference between cursor stability and repeatable read isolation levels?
How to design maps
What is difference between rollback and commit?
How does one remove entries from the SCT02 table?
What is the physical storage length of time data type?
Is db2 free?
I need to view the number of tables existing under one particular Owner. Is it possible? If so, pl give the SQL query for this?
Can you search give an array in the WHERE clause of a db2 query?
What is phantom read in db2?
What is a DB2 plan?
How to insert more than one record using insert?
What is RUNSTATS?