SQL Plus

From TekiWiki

Jump to: navigation, search

This whole wiki has now moved to http://www.springboardsolutions.com/wiki

Go to this page SQL Plus

Line 43: Line 43:
===Editing Your SQL===
===Editing Your SQL===
-
Use your favourite text editor to edit files - for instance - TextPad:
+
Use your favourite text editor to edit files - for instance - TextPad - by altering the Sql*Plus system variable:
<pre>
<pre>
Line 60: Line 60:
/* Post 10gR2 client */
/* Post 10gR2 client */
set serveroutput on size unlimited
set serveroutput on size unlimited
 +
</pre>
 +
 +
===Set a Spool Filename with Database Name and Timestamp===
 +
 +
Set a SQL*Plus column by a database query and use this as part of the name of the file:
 +
 +
<pre>
 +
column colFileSuffix new_value FileSuffix
 +
 +
select name || '_' || to_char(sysdate,'YYYYMMDD_HH24MISS') colFileSuffix
 +
from v$database;
 +
 +
spool ReportFile_&&FileSuffix
 +
...commands...
 +
spool off
</pre>
</pre>

Revision as of 01:08, 11 December 2011

Personal tools