Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: help - spool file name - use variable
How about "spool &report_id.dat" ?
-----Original Message-----
Sent: Monday, April 23, 2001 6:22 PM
To: Multiple recipients of list ORACLE-L
I'm writing a sql script file (first run couple of queries, insert results into a temp table), at last, the data need to spool out to separate files. the requirement was want the report name to be able to change depend on the query. Therefore, I have a variable in the temp table. Now I want to be able to enclose this variable name in my report name. like:
temp table has: report_id, division, room ...
So, the report will like:
SPOOL C:\c\CYCLE_COUNT_${REPORT_id}.DAT ... ( for report 1)
SPOOL C:\c\CYCLE_COUNT_${REPORT_id}.DAT ... ( for report 2)
however, when I'm coding now, the '${REPORT_id}" is unknown. The value variable will get at run time. I don't know how to be dynamic.
Hope I explain better this time. Thanks a lot.
Diego Cutrone <dcutrone_at_afip.gov.ar> wrote:
Hi,
I don't quite understand your question, so here's what I understood:
Just enclose the variable name with "{ }" , here's an example
/home/oracle> export temp_variable=TEST
/home/oracle> echo "this_is_a_$temp_variable_only"
this_is_a_
-- wrong
/home/oracle> echo "this_is_a_${temp_variable}_only"
this_is_a_TEST_only
/home/oracle>
Hope it helps
To: Multiple <mailto:ORACLE-L_at_fatcity.com> recipients of list ORACLE-L
Sent: Monday, April 23, 2001 2:50 PM
Hello:
I'm trying to spool out couple of files from my temp table. Part of the file name is coming from a variable from the temp table. I use:
spool C:\CYCLE_COUNT_$temp_variable.DAT
but it's only one physical name instead of using the variable.
How can I code the variable name as part of (spool) file name?
Thanks
Do You Yahoo!?
Yahoo! <http://auctions.yahoo.com/> Auctions - buy the things you want at
great prices
Do You Yahoo!?
Yahoo! <http://auctions.yahoo.com/> Auctions - buy the things you want at
great prices
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Gogala, Mladen INET: MGogala_at_oxhp.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Tue Apr 24 2001 - 12:14:24 CDT
![]() |
![]() |