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 to know the primary key of a table without defining the primary key in the table?
What are bind parameters in db2?
what are the max. & min. no. of partitions allowed in a partition tablespace?
Can i insert bulk records into a db2 table using qmf of spufi only............!!!
I have a table(product),It contain fields(productname,cost). I want to retrieve the product name ,which cost is second maximum in the table?
i have cobol+ db2 program but it contains n number of subprograms for this how many dbrm members i need to mention in bind process
What is runstats db2?
What is an EXPLAIN in DB2. How and what is the steps followed in EXPLAIN command. Can all the queries be used in EXPLAIN command to check the performance.
What is a thread?
What is image copy in db2?
DB2: A calls B once sucessfull and second time when it calls says curson is open why is it so?
What is node in db2?