Professional Documents
Culture Documents
Writing Advanced Scripts: Reserved
Writing Advanced Scripts: Reserved
SQL script
•• SQL
SQL can
can be
be used
used to
to generate
generate scripts
scripts in
in SQL
SQL
•• The
The data
data dictionary
dictionary
–– Is
Is aa collection
collection of
of tables
tables and
and views
views that
that contain
contain database
database
information
information
–– Is
Is created
created and
and maintained
maintained by
by the
the Oracle
Oracle server
server
SPOOL dropem.sql
SQL STATEMENT
SPOOL OFF
SET FEEDBACK ON
SET PAGESIZE 24 Set system variables
SET ECHO ON back to the default
value.
SET FEEDBACK ON
SET PAGESIZE 24
SET ECHO ON
SELECT
'INSERT INTO departments_test VALUES
(' || department_id || ', ''' || department_name ||
''', ''' || location_id || ''');'
AS "Insert Statements Script"
FROM departments
/
SET PAGESIZE 24
SET HEADING ON ECHO ON FEEDBACK ON
Source Result
'''X''' 'X'
'''' '
''''||department_name||'''' 'Administration'
''');' ');
;;