If a table contains no data, you can use the ALTER TABLE definition SQL statement to change its definition to a falsification prevented table. If the table contains data, ALTER TABLE cannot be used to change it to a falsification prevented table. In such a case, you must first unload the data, change the table to a falsification prevented table, and then load the data back into the table. The following example describes how to change an existing falsification-unprevented table containing data to a falsification prevented table:
pdhold -r RDAREA01 -c |
pdrorg -k unld -t T1 -W bin control_file |
PURGE TABLE T1 |
ALTER TABLE T1 CHANGE COLUMNA UPDATE |
ALTER TABLE T1 CHANGE INSERT ONLY WHILE 10 YEARS BY COLUMNB |
pdload -b -W T1 control_file |
pdcopy -m /hirdb/rdarea/mast/mast01 -M r -p /usr/hirdb/pdcopy/list/list01 |
pdrels -r RDAREA01 -o |
To determine the timing of setting the falsification prevention option, check the values in the SQL_TABLES data dictionary table. Table 13-9 lists and describes the values in the SQL_TABLES table.
Table 13-9 Meanings of values in the SQL_TABLES table
Falsification prevention option setting | SQL_TABLES | |
---|---|---|
Value of INSERT_ONLY column | Value of CHANGE_TIME_INSERT_ONLY | |
Not specified | Null | Null |
Specified during execution of CREATE TABLE | Y | Null |
Specified during execution of ALTER TABLE | Y | Date and time the table was changed to falsification prevented table |