pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
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 21:08:37 -0700 (PDT)
Message-ID: <577132.21411.qm@web54305.mail.re2.yahoo.com> (raw)
In-Reply-To: <66c468170709031734o80d8e2o92f18d23ac5b8c72@mail.gmail.com>

...

> When you say use rules to inject constants, how would I go about
> doing this? Could you maybe give a brief example?

create view tab1_dml as select * from tab1;

-- note:
-- CONSTANT1 = 8
-- CONSTANT2 = 15

create or replace rule tab1_insert as
   on insert
   to tab1_dml
do instead(
   insert into tab1( c1, c2 )
   values( new.c1 * 8, 15 );
);



       
____________________________________________________________________________________
Yahoo! oneSearch: Finally, mobile search 
that gives answers, not web links. 
http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC



view thread (3+ messages)

Message-ID: <577132.21411.qm@web54305.mail.re2.yahoo.com>
Permalink:  ../577132.21411.qm@web54305.mail.re2.yahoo.com/
Also on:    postgresql.org/message-id/577132.21411.qm@web54305.mail.re2.yahoo.com

 · 

reply

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: <577132.21411.qm@web54305.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