Saturday, 24 August 2013

DB2 SQL Execution Validation


A program that includes SQL statements needs to have an area set apart for communication with DB2an SQL communication area (SQLCA). 
When it processes an SQL statement in a program, DB2 places return codes in the SQLCODE and SQLSTATE host variables or corresponding fields of the SQLCA.
The return codes indicate whether the executed statement succeeded or failed. 
Because the SQLCA is a valuable problem-diagnosis tool, it is a good idea to include instructions to display some of the information contained in the SQLCA in your application programs. 
For example, the contents of SQLERRD(3), which indicates the number of rows that DB2 updates, inserts, or deletes, could be useful. If SQLWARN0 contains W, DB2 has set at least one of the SQL warning flags (SQLWARN1 through SQLWARNA).


Created with Artisteer

No comments:

Post a comment