Reverse Engineering Tables and Indexes

Even though many CASE tools allow you to reverse engineer tables and indexes, you can always use straight SQL for this purpose. You can retrieve all the information that you need from the data dictionary to rebuild tables and indexes, but doing so effectively is difficult without the use of a procedural language, such as PL/SQL or a shell script. To rebuild tables and indexes, you simply need to query the data dictionary for information needed to rebuild the tables and indexes—such as column names and data types—then convert the returned data to CREATE TABLE and/or CREATE INDEX statements.

We usually use embedded SQL within a shell script, simply due to a matter of preference. Procedural language functions ...

Get Sams Teach Yourself SQL in 21 Days, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.