From: chester c young <chestercyoung@yahoo.com>
To: blay bloo <blaybloo@googlemail.com>
Cc: sql pgsql <pgsql-sql@postgresql.org>
Subject: Re: Execute SQL statements with 'context'/predefined variables
Date: Mon, 3 Sep 2007 14:59:11 -0700 (PDT)
Message-ID: <692669.75275.qm@web54306.mail.re2.yahoo.com> (raw)
In-Reply-To: <66c468170709031102j1e21d313v512c488ccc289505@mail.gmail.com>
> I was wondering if it is possible to set the 'context' for running an
> sql command
Oracle has a Context('varname') that returns the value of varname for
the session. to best of my knowledge pg has nothing like this.
> I guess bottom line, is it possible to execute a bunch of SQL
> statements with some predefined variables?
you could use rules to inject you constants as long as you were dealing
with known tables/views; you'd have to rewrite the rules each time the
constants changed; the rules are not session oriented - each sessions
would use the same rule.
(if you have not used pg rules imho you are in for a very pleasant
surprise.)
____________________________________________________________________________________
Luggage? GPS? Comic books?
Check out fitting gifts for grads at Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: chestercyoung@yahoo.com, blaybloo@googlemail.com
Subject: Re: Execute SQL statements with 'context'/predefined variables
In-Reply-To: <692669.75275.qm@web54306.mail.re2.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox