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: Using Substitution Variables Dynamically in File Names

Re: Using Substitution Variables Dynamically in File Names

From: <sfitzgerald02_at_gmail.com>
Date: Wed, 17 Oct 2007 11:25:38 -0000
Message-ID: <1192620338.854007.208810@q5g2000prf.googlegroups.com>


Sorry, I should have provided more info on the variables.

/*
##############################################
#
# COMMON VARIABLES
#
##############################################
*/
var companyid varchar2(11);

begin
select &companyid into :companyid from dual; end;
/

set pages 9999
set linesize 160
set feedback off

column tm new_value file_time noprint
select to_char(sysdate,'YYYYMMDD') tm from dual;

col sn noprint new_value company_name
select scompanyname sn from tblcompany where ncompanyid= :companyid spool /home/utils/companyReports/&&company_name.&file_time..txt

prompt -- &&company_name --;

What results is as follows:

The file does not spool which I suspect is because the &&company_name.&file_time..txt does not result in a valid file name. The file_time variable does work though. Received on Wed Oct 17 2007 - 06:25:38 CDT

Original text of this message

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