SQL/MP Programming Manual for C

Data Retrieval and Modification
HP NonStop SQL/MP Programming Manual for C429847-008
4-3
Recovering From SQL Error 8204
1. A program accesses a table or view using one or more static DML statements
(SELECT, INSERT, UPDATE, or DELETE) or a static cursor. The SQL executor
opens the table or view for the program.
2. Any locks associated with the statements in Step 1 are released (for example,
because the transaction ended). Another user then runs one of these DDL
statements or utility operations for the table or view, which causes the system to
terminate the program’s open:
ALTER TABLE with ADD COLUMN, ADD PARTITION, DROP PARTITION, or
RENAME
ALTER TABLE with AUDIT, BUFFERED, LOCKLENGTH, MAXEXTENTS,
SERIALWRITES, TABLECODE, or VERIFIEDWRITES
ALTER INDEX with ADD PARTITION, DROP PARTITION, or RENAME
ALTER INDEX with BUFFERED, MAXEXTENTS, TABLECODE,
SERIALWRITES, or VERIFIEDWRITES
ALTER VIEW with RENAME
CREATE CONSTRAINT and CREATE INDEX
DROP CONSTRAINT, DROP INDEX, DROP TABLE,
or DROP VIEW (protection view only)
UPDATE STATISTICS
COPY, LOAD, PURGEDATA, or RESTORE utility operation
(A disk or network line that goes down and then comes up again can also cause
the system to terminate a program’s open.)
3. The program tries to run another SQL statement for the table or view.
4. The SQL executor tries to recover, as described next. However, if it cannot recover
from the error, the executor returns error -8204 to the program, and the program
loses its open for the table or view.
Recovering From SQL Error 8204
If a program runs a static DML statement and the open for a table or view it is using
has been lost because of a DDL statement or utility operation, the SQL executor tries
to recover as described next.
Simple DML Statements
For static DML statements (SELECT, INSERT, UPDATE, and DELETE), the SQL
executor reopens the changed table or view and then retries the DML statement once
using the new definition of the table or view. If the retry is successful, the SQL executor
returns a warning (8204) to the program. However, if the retry fails, the SQL executor
returns an error (-8204).