SQL/MX 2.x Reference Manual (G06.24+, H06.03+)
SQL/MX Statements
HP NonStop SQL/MX Reference Manual—523725-004
2-221
MXCI Examples of SET TABLE TIMEOUT
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;
•
Reset all the lock timeout settings. All tables will use the static lock timeout value
specified by the system or by the CONTROL statement:
SET TABLE * TIMEOUT RESET;
C Examples of SET TABLE TIMEOUT
•
Set the lock timeout value for all the tables to 30 seconds:
EXEC SQL SET TABLE * TIMEOUT 3000;
•
Set the lock timeout value for the CUSTOMER table to 1 minute:
EXEC SQL SET TABLE CUSTOMER TIMEOUT '6000';
SELECT CUSTNUM, CUSTNAME, STREET, CITY, STATE, POSTCODE
INTO :hv_custnum, :hv_custname,
:hv_street, :hv_city, :hv_state, :hv_postcode
FROM CUSTOMER
WHERE CUSTNUM = :hv_custnum;
•
This SET TABLE TIMEOUT statement has no effect because the cursor is already
open:
EXEC SQL DECLARE mycursor CURSOR
FOR SELECT custname FROM customer;
EXEC SQL OPEN mycursor;
EXEC SQL SET TABLE customer TIMEOUT '-1';
EXEC SQL FETCH mycursor INTO :customer_name;
•
Reset the timeout value for the CUSTOMER table to 30 seconds (set earlier for all
tables):
EXEC SQL SET TABLE CUSTOMER TIMEOUT RESET;