If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Error-Handling Language Constructs

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-28-06, 04:50
vkd_17 vkd_17 is offline
Registered User
 
Join Date: Apr 2006
Location: Mumbai
Posts: 2
Error-Handling Language Constructs

INFORMIX-4GL uses a global variable status and a global record SQLCA (SQL communication area) to detect, record, and handle all exceptions in processing.

The global variable status indicates errors from SQL statements and interactive statements. The global record SQLCA contains extensive information about the actions carried out by the database engine and the errors and warnings encountered in executing SQL statements and only SQL statements.

The SQLCA record is defined as follows:


DEFINE sqlca RECORD
sqlcode integer,
sqlerrm char(71),
sqlerrp char(8),
sqlerrd array[6] of integer,
sqlwarn char(8)
END RECORD

The values contained in the SQLCA record are as follows:

sqlca.sqlcode 0 for a successful execution of the SQL statement.
NOTFOUND(100) For a successful SQL execution that returns no rows or runs out of rows.
Negative number Error number after an unsuccessful SQL execution. The variable status is set to sqlca.sqlcode.
sqlca.sqlerrm Not used.
sqlca.sqlerrp Not used.
sqlca.sqlerrd[1] Not used.
sqlca.sqlerrd[2] The serial value of the record inserted or the ISAM error code.
sqlca.sqlerrd[3] Number of rows processed by the SQL statement.
sqlca.sqlerrd[4] Estimated CPU cost for the query.
sqlca.sqlerrd[5] Offset of the error into the SQL statement.
sqlca.sqlerrd[6] The rowid of the last row selected.
sqlca.sqlwarn[1] Blank if there are no other warnings; W if one of the other array elements is set.
sqlca.sqlwarn[2] W if a value was truncated to fit into a char variable or for a DATABASE statement, if this is a database with transactions.
sqlca.sqlwarn[3] W if an aggregate function encountered a NULL when evaluating or for a DATABASE statement, if this database is ANSI-compliant.
sqlca.sqlwarn[4] W if the number of items in the select list is not the same as the number of variables in the into clause or for a DATABASE statement, if this is an INFORMIX-OnLine database.
sqlca.sqlwarn[5] W if float-to-decimal conversion is used.
sqlca.sqlwarn[6] W if the DBANSIWARN variable is set and the last statement executed is not ANSI-compliant.
sqlca.sqlwarn[7] Not used.
sqlca.sqlwarn[8] Not used.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On