www .Just SQL. com  

a site for the SQL*Plus specialist

 Home  Intro Remarks  Tutorial  Rules  The Scripts

Points to Consider while building nested scripts...

(not really 'rules')

Site Map

SQL>
SQL>
SQL>

Layout - is crucial for clarity

Build from the inner-most query first; use dummy values initially to help understanding

Quotes - The inner, or L1 query is enclosed by an opening and closing single quote

Double quotes - quotes are doubled where they already exist within an embedded query

Field Separator:

Use '|| chr(10) ||' to force a line feed

Use '||' as an alternative to the ',' field separator to eliminate any trailing spaces in a column attribute

The 'SET' enviroment controls:

Control your environment with the ‘set’ commands
Hold these settings in a script file to action before building spooled nested scripts
Switch selected items on/off within script files
Switch these settings back on via another script file at end

 Spooling -

Use ‘spool file’ / script / ’spool off’ / ‘@spool file’ construct

For an 'n' nested query, 'n-1' spool files will be required.

SQL>
SQL>
SQL>

[Home] [Inspiration] [About this Site] [Scripts Intro] [Publications]

e-Mail Connection