Database Reference
In-Depth Information
Figure
12-16
provides another illustration of dynamic SQL. A detailed explanation is
beyond the scope of this course; however a cursory clarification is in order, and will suffice:
•
The SPOOL statement (sixth line down) causes the output of the
subsequent query to be redirected to the file specified.
•
The SELECT statement causes a series of rows to be written to the
spool file. These rows actually contain SQL statements to backup
tablespaces found in the current database.
•
The spool file can therefore be subsequently run as an SQL script
to backup these tablespaces.
Figure 12-16.
Automatic Backup of Tablespaces in a Database via Dynamic SQL
Statements
12.16 Summary and Concluding Remarks
Relatively speaking, this has been a rather lengthy chapter. In recognition, the following
paragraphs provide a summary of the various related topics covered, followed by some
concluding remarks.
The
Insert
statement facilitates insertion of data into a specific table. The statement
allows data insertion in one of three ways:
•
Insertion by specifying literal column-values for a row of a table
•
Insertion via execution-time variables for a row of a table
•
Insertion by redirecting the result of a query into a table (multiple
records insertion is supported by this strategy)