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: Dynamic spool file in SQL*Plus ?

Re: Dynamic spool file in SQL*Plus ?

From: Jaap W. van Dijk <j.w.vandijk.removethis_at_hetnet.nl>
Date: Wed, 27 Feb 2002 11:16:44 GMT
Message-ID: <3c7cbf60.745941@news.freeler.nl>


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

Original text of this message

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