Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Unique spool filenames?

Re: Unique spool filenames?

From: Brett Neumeier <bogus_at_address.for.spam>
Date: 1997/05/16
Message-ID: <337CD927.5658@address.for.spam>#1/1

Adolphus Li wrote:
>
> Use ltrim to remove the leading spaces.
> A. Li
>

 [...]
> : >> Is there a way within SQLPlus to create unique filenames for spool
> : >> files. In unix one can use 'filename.$$' which will append the
> : >> process ID. Can I do something similar from SQLPlus, running under
> : >> unix?
> : >
> : >Surely. You can use the auditing session identifier, obtained
> : >using userenv('SESSIONID').
> : >

 [...]
> : There is one little problem with it that I don't know how
> : to handle:
 

> : SQL> column unique_id new_value uid noprint
> : SQL> select userenv('SESSIONID') unique_id from dual;
> : SQL> spool filename.&UID
> : Illegal spool file name: "filename. 46080" (bad character: ' ')
 

> : I've tried all sorts of format commands on the 'column' statement
> : with no luck. Any ideas?

Adolphus' suggestion will work, but you can also get around the problem this way:



select 'filename.' || userenv('SESSIONID') unique_id from dual; spool &UID

this will create "filename.3453252.lst" (with whatever the actual session id is. Customize to your heart's desire.

-bn
neumebm_at_hpd.abbott.com Received on Fri May 16 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US