SQL/MP Messages Manual
Message Handling
HP NonStop SQL/MP Messages Manual—427720-006
1-5
Programmatic Recovery Information
Programmatic Recovery Information
This subsection contains guidelines for handling SQL/MP errors from within a program.
For more information about your host language, see the SQL/MP programming
manual.
SQL/MP Error Philosophy
SQL/MP messages are intended for an SQL user, system operator, system manager,
or database administrator. They are not intended to be handled programmatically.
Therefore, HP does not ensure that a specific condition produces the same message
across releases. Introduction of new features can change the path by which NonStop
SQL/MP checks for errors.
HP guarantees that the conditions leading to these three messages always produce
these numbers:
•
0000-Successful SQL operation.
•
0100-No rows selected or modified.
•
8300-File-system error occurred on value-1.
For all other SQL messages, an SQL statement on a given release might return a
different error than it did in a previous release. As a result, if you handle specific errors
within your programs, your application might not capture the error in a future release.
If you pass messages directly through to users or store them in SQL/MP tables, your
programs will not be affected by changes in error generation.
Obtaining Error Information
The SQL executor stores run-time status information in a standard work area called the
SQL/MP Communications Area (SQLCA). The SQLCA receives errors or warnings
after execution of every SQL statement (dynamic and static). The SQLCODE field in
the SQLCA contains the message number.
You can check the contents of the SQLCA in these ways:
•
Use the SQLGETINFOLIST procedure to retrieve message information from the
SQLCA. The SQLGETINFOLIST interface protects applications from changes in
the SQLCA data structure. This method is the one recommended by HP.
•
Use the WHENEVER directive to check the SQLCODE field.
•
Check the SQLCODE field of the SQLCA directly. This method is the least
preferred.
You can also use constraints to check for errors.