Change to Create Table statement to stop accidental deletion of the Table

It is always a danger that someone will accidentally drop (delete) the wrong file, not maliciously just accidentally.

01 CREATE TABLE MYLIB.TABLE1
02 (COLUMN1 CHAR(1)) ;

03 DROP TABLE MYLIB.TABLE1 ;

Statement ran successfully

Within the new release of IBM i 7.5 is an addition to the Create Table statement that can prevent this. This does appear to be only in 7.5, I cannot find a mention of this in the documentation for IBM i 7.4 TR6.

This addition to the Create Table statement is: WITH RESTRICT ON DROP

Read more »

Verified by MonsterInsights