Re: Execute SQL statements with 'context'/predefined variables - Mailing list pgsql-sql

From chester c young
Subject Re: Execute SQL statements with 'context'/predefined variables
Date
Msg-id 692669.75275.qm@web54306.mail.re2.yahoo.com
Whole thread Raw
In response to Execute SQL statements with 'context'/predefined variables  ("blay bloo" <blaybloo@googlemail.com>)
List pgsql-sql
> 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


pgsql-sql by date:

Previous
From: Richard Broersma Jr
Date:
Subject: Re: Constraints for grouping
Next
From: PostgreSQL Admin
Date:
Subject: Re: Constraints for grouping