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 |
DB2 is a A) data base/data communication system B) data base C) RDBMS D) Programming language
When you are working with the project after coding what will u do? Like what type of documents u will prepare? How will u do testing?
What is the SQL query to select, delete and get count of duplicate rows in DB2?
what is commit & rollback? When and where is used while compiling a cobol-db2 program?
Request to database but database is not available so what is was abend is raised?
what is a trigger and types of triggers
What is deadlock in db2?
What is deadlock?
what is difference between random and sequence file access
Explain about dbrm.
Define sqlca.
What are the four lockable units for DB2?