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 |
How can you display the current date & current time ?
What is a DB2 bind?
Why do chiropractors use drop table?
How do you do the EXPLAIN of a dynamic SQL statement?
How many clustering indexes can be defined for a table?
What do the initials DDL and DML stand for and what is their meaning?
Why do we need reorg in db2?
What is plan in cobol db2?
What is a Resource Control Table(RCT)? Describe its characteristics.
The only place of VSAM KSDS in DB2 is?
what is the soft code for deadlock ?
How do I import a csv file into db2?