SQL/MX 2.x Reference Manual (H06.04+)

SQL/MX Statements
HP NonStop SQL/MX Reference Manual540440-003
2-216
Considerations for SET TABLE TIMEOUT
Considerations for SET TABLE TIMEOUT
The SET TABLE TIMEOUT statement does not perform any security checks on a
table.
A CONTROL statement is a directive that affects the compilation of subsequent
DML statements but produces no executable code. A SET TABLE TIMEOUT
statement, however, produces executable code and has no effect on the
compilation of other statements.
The SET TABLE TIMEOUT statement does not change the SQL/MX compilation
defaults or CONTROL statement settings. A DML statement explicitly compiled
after the execution of a SET TABLE TIMEOUT statement internally contains the
static CONTROL statement timeout values, which are overridden by SET TABLE
TIMEOUT.
The SET TABLE TIMEOUT statement affects the run-time environment of an
embedded SQL program. The explicit SQL/MX compilation defaults or CONTROL
settings are not changed. DML statements compiled either before or after the
execution of SET TABLE TIMEOUT still contain the same static timeout values in
their code.
The timeout values set by executing a SET TABLE TIMEOUT statement override
the CONTROL directives that are in effect at the execution of subsequent DML
statements. Therefore, you do not have to recompile a DML statement to change
its timeout settings. The SET TABLE TIMEOUT statement also has a RESET
option that clears previously set dynamic values, making the static values effective
again.
The timeout values set by a SET TABLE TIMEOUT statement are checked only
when a DML statement is executed or when an SQL cursor is opened. Therefore,
the statement has no effect on a cursor that is already open.
MXCI Examples of SET TABLE TIMEOUT
Set the lock timeout value for all the tables to 30 seconds for the current session:
SET TABLE * TIMEOUT 3000;
Set the lock timeout value for the CUSTOMER table to one minute:
SET TABLE customer TIMEOUT '6000';
SELECT custnum, custname FROM customer;
Reset the timeout value for the CUSTOMER table to 30 seconds (set earlier for all
tables):
SET TABLE customer TIMEOUT RESET;
This statement has no effect; the PARTS table still uses the lock timeout value of
30 seconds (set earlier for all tables):
SET TABLE parts TIMEOUT RESET;
Embed
Embed
Embed