When using the Modify statement in an application, the DBMS Server returns the number of rows modified in the SQLCA's sqlerrd(3) field. If the statement does not modify any rows, the DBMS Server sets the SQLCA's sqlcode to 100.
The preprocessor does not verify the syntax of the with_clause. The values in the with_clause options can be specified using host language variables. Any other parameters cannot be specified using host language variables.
You must own the table or have the security privilege and connect as the owner.
The Modify statement requires an exclusive table lock. Other sessions, even those using readlock=nolock, cannot access the table until the transaction containing the modify statement is committed.
Two exceptions are the modify to table_debug variant, which takes a shared table lock, and the concurrent_updates option, which takes only a brief exclusive lock at the end of the modify operation.
The following are Modify statement examples:
modify employee to isam on eno;
If eno is the first column of the employee table, the same result can be achieved by:
modify employee to isam;
modify employee to reconstruct
with fillfactor = 60;
modify job to hash on jid, salary
with compression;
modify job to hash on jid, salary
with compression, fillfactor = 75,
minpages = 7, maxpages = 43;
modify job to hash on jid, salary
with compression, minpages = 16;
modify dept to heap with location=(area4);
modify dept to heapsort on dno;
modify employee to heapsort on ename asc,
age desc;
modify employee to btree on ename
with fillfactor = 50, leaffill = 40;
modify table1 to btree
with compression=(nokey, data);
modify index1 to btree with compression=(key);
modify empidx to reconstruct with persistence;
modify inventory to btree
with allocation = 10000, extend = 1000;
modify empidx to btree unique on empid
with unique_scope = statement;
MODIFY lineitems PARTITION p1 TO REORGANIZE
WITH LOCATION = (history_loc);
modify lineitems to reconstruct with nopartition;