Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Dynamic spool file in SQL*Plus ?
In SQL*Plus you can use the NEW_VALUE clause of the COLUMN command to
fill a variable with a value, like this:
column spfile new_value vspfile
SELECT substr(user,1,8)||'.txt' spfile from dual;
and then
spool &vspfile
...
Jaap.
On Tue, 26 Feb 2002 14:45:51 +0100, Jarek Palka <jpalka_at_interia.KILLSPAM.pl> wrote:
>Is it possible to set spool filename dynamic based on return value of SELECT
>statement ?
>
>I'd like to set spool filename the same as username to which I'm connecting:
>
>Such statement don't work :-((
>
>SELECT substr(user,1,8)||'.txt' INTO :uname FROM DUAL;
>SPOOL :uname
>-- script body
>SPOOL off
>--
>____________________________________________________________
>Jaroslaw Palka <jpalka_at_interia.KILLSPAM.pl>
>Katowice POLAND <Remove KILLSPAM from address >
>
Received on Wed Feb 27 2002 - 05:16:44 CST