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 database alias db2?
pls explain the precompilation process of cobol-db2 pgm
What is the purpose of the SDSNLOAD dataset in the STEPLIB while running DB2 programs?
What are packages in db2?
select * from orders where odate between '2010-01-01'and '2010-03-31' How do u fetch this into cursor?
Which isolation level provides highest data integrity?
Suppose the outcome of executing a query results in a row having null. Based on the answer how you use it? Its declaration and inclusion?
What happens to a tablespace when its recovery infromation has been removed and a full recovery is no longer possible?
what is the difference between normal select query and currosor
Hello All, We have requirment to Replace BMC Db2 Load product thru CA FAST LOADPlus product. Do anyone have JCL to for FAST LOADPLUS and what all are thing need to take in consideration.
what is sql abend code -801,-802?
What are some SQL aggregates and other built-in functions?