Database Reference
In-Depth Information
The same effect can be obtained by hard-coding the path name into the
script using only a single @ character command as shown following. Obvi-
ously, calling B.SQL with a single @ command character would require the
B.SQL and C.SQL calls to be executed with full path names. The A.SQL
script looks as follows:
SET SERVEROUTPUT ON;
EXEC DBMS_OUTPUT.PUT_LINE('Executing A.SQL');
@C:\TEMP\B.SQL;
EXEC DBMS_OUTPUT.PUT_LINE ('Completed A.SQL');
SET SERVEROUTPUT OFF;
The script B.SQL looks as follows:
EXEC DBMS_OUTPUT.PUT_LINE('Executing B.SQL');
@@C.SQL;
EXEC DBMS_OUTPUT.PUT_LINE ('Completed B.SQL');
The script C.SQL looks as follows:
EXEC DBMS_OUTPUT.PUT_LINE('Executing C.SQL');
EXEC DBMS_OUTPUT.PUT_LINE ('Completed C.SQL');
Look at the execution of the three aforementioned scripts as shown in
Figure 8.13.
Creating and using scripting in SQL*Plus is easy. There are a few sim-
ple commands to remember. Now let's go onto formatting of specific que-
ries or reports, as opposed to using environmental variables to change
global settings.
8.3
Formatting Query Output in SQL*Plus
Scripting with simple queries and variables is just the beginning of the
reporting process. In this section, you learn how to customize reports by
adding environmental settings to the script, changing column headings,
adding page headings, and creating reports with outlined structures. Let's
start with column settings.
 
Search WWH ::




Custom Search