Testing for errors

Embedded SQL places a return code in the SQLCODE variable to indicate the success or failure of each SQL statement sent to Adaptive Server Enterprise. You can either test the value of SQLCODE after each Embedded SQL statement or use the whenever statement to instruct the precompiler to write the test code for you. The whenever statement is described later in this chapter.