Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: help - spool file name - use variable
I tried, but didnot work.
I hard code them now.
Thanks
"Gogala, Mladen" <MGogala_at_oxhp.com> wrote:
How about "spool &report_id.dat" ?-----Original Message-----Sent: Monday, April 23, 2001 6:22 PMTo: Multiple recipients of list ORACLE-LI'm writing a sql script file (first run couple of queries, insert resultsinto 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 thequery. Therefore, I have a variable in the temp table. Now I want to be ableto 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 valuevariable will get at run time. I don't know how to be dynami!
!
c.Hope I explain better this time. Thanks a lot.Diego Cutrone 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----- Original Message ----- To: Multiple recipients of list ORACLE-L Sent: Monday, April 23, 2001 2:50 PMHello: I'm trying to spool out couple of files from my temp table. Part of the filename is coming from a variable from the temp table. I use: spool C:\CYCLE_COUNT_$temp_vari!
!
able.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! Auctions - buy the things you want atgreat prices_____ Do You Yahoo!?Yahoo! Auctions - buy the things you want atgreat prices-- Please see the official ORACLE-L FAQ: http://www.orafaq.com-- Author: Gogala, MladenINET: MGogala@oxhp.comFat City Network Services -- (858) 538-5051 FAX: (858) 538-5051San Diego, California -- Public Internet access / Mailing Lists--------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail messageto: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and inthe me!
![]() |
![]() |