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: save sqlplus conf in a variable

Re: save sqlplus conf in a variable

From: Frank van Bortel <fvanbortel_at_netscape.net>
Date: Thu, 08 Jan 2004 22:44:59 +0100
Message-ID: <btkieo$n9d$1@news1.tilbu1.nb.home.nl>


Daniel Morgan wrote:

> Sunil wrote:
> 

>>> you can save
>>> ALL of your sqlplus settings to a sql script file and then reset them
>>> at a
>>> later point. There is an example of this (and a lot more useful stuff
>>> besides) at www.ixora.com.au/scripts (you will find the sqlplus settings
>>> ones under prerequisites).
>>
>>
>>
>> Is it possible to save a particular value in a sqlplus variable and later
>> set it back to the original value.
>>
>> I need to do something like this. I am adding a call to new sql script
>> to a
>> huge sql script which has calls to other sql scripts. I need to do "set
>> define off" in my script but I need to set the value of define to what
>> was
>> there originally at the end of my script. The solution at
>> www.ixora.com.au/scripts will work for me. But I am interested in
>> knowing if
>> there is any easier way as I am interested in only the "define" value
>>
>> Thanks,
>> Sunil.
> 
> 
> No. From the sounds of what you are writing you shouldn't be writing 
> scripts but rather procedures. If you want to store values ... store 
> them in a table and query them back into memory when the proc is run.
> 

I'd say there's some miscommunication here... The OP just wants to remember a variable value in a SQL*Plus (assumption) script. Lookup 'new value' in the SQL*Plus guide, if that's what you are using.

But you don't need it - set define off will just disable it, not change the value. Set it on again, and it has the original value again. And... it is session dependent. Exit at the end of your script, and you're done. Any new session will have the default value.

-- 

Regards,
Frank van Bortel
Received on Thu Jan 08 2004 - 15:44:59 CST

Original text of this message

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