The Better Way to Delete Physical Files
February 11, 2004 Hey, Ted
You missed a possible link between two articles in the January 14 issue! The first article is “Why SQL, Why Now,” and the second is “Deleting with a Generic File Name.”
The missing link is that, if you use SQL (to define your database) and issue the command DROP TABLE, the indexes and logical files are deleted (dropped) also! So that’s one of the many reasons why you should use SQL.
–Wim
Thanks for the advice, Wim. Several other readers wrote with similar comments.
SQL’s DROP TABLE command will indeed drop a physical file and the logical files that reference it. However, the physical and logical files do not have to be defined through SQL; they can be defined with DDS. The drop will even delete logical files whose names are not generic with the physical file’s name and logical files that are not in the library that contains the physical file.
There may be times when you don’t want to drop a table (delete a physical file) if it has logical files. In such a case, add the word RESTRICT to the end of the command.
drop table mylib/customer restrict
–Ted