Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Unique spool filenames?
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:
-bn
neumebm_at_hpd.abbott.com
Received on Fri May 16 1997 - 00:00:00 CDT
![]() |
![]() |