Re: using a variable as a "macro"

From: cumin <jkilbourne_at_gmail.com>
Date: 18 Dec 2005 08:04:07 -0800
Message-ID: <1134921847.836323.280680_at_g43g2000cwa.googlegroups.com>


Malcolm Dew-Jones wrote:
> HansF (News.Hans_at_telus.net) wrote:
> : On Fri, 16 Dec 2005 07:34:21 -0800, cumin wrote:
>
> : > Is there a way to access an environmental variable in sqlplus? A lot of
> : > the ad hoc queries I run have the phrase
> : >
> : > and tty in ('IN','BN','SCD','SBD','SCDF','SBDF','SCDC','SBDC')
> : >
> : > and I am too lazy to type that in so much. Is there a way to set and
> : > retrieve a string variable in sqlplus that will let mr put this string
> : > into numerous queries? I'd like the vairable to live in the databse,
> : > but if it needs to be an OS environent variable that's ok too.
> : >
> : > Thanks
>
> : How about looking up 'substitution variables' in the docco. Or are you
> : too lazy for that as well?
>
> Also, by example
>
> select * from table
> where
> _at_mycriteria
> ;
>
>
> uses the file mycriteria.sql

[Quoted] thank you all; even the "substitution variable" post was helpful (but I don't think substitution variables can be made to persist across numerous sessions).

[Quoted] I appreciate your responses to my question. Received on Sun Dec 18 2005 - 17:04:07 CET

Original text of this message