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 |
i have a db2 variable how do u declare tht into working storage section ?
B37 abend during spufi?
What is the use of db2 optimizer?
What is a Resource Control Table(RCT)? Describe its characteristics.
My sql statement select avg(salary) from emp yields inaccurate results. Why?
What are db2 objects?
What is the SQL Communications Area and what are some of its key fields?
What is plan in cobol db2?
What is the difference between static and dynamic SQL?
What are the different methods of accessing db2 from tso? How is the connection established between TSO & DB2?
in a table consist of 1000 records among that i was updated 145 record how could i know that ..list of recently updated record's and where could i see those updated record's....pls help me out....
How will you return the number of records in table?