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

> 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


pgsql-sql by date:

Previous
From: "Luiz K. Matsumura"
Date:
Subject: Cast on character columns in views
Next
From: Richard Broersma Jr
Date:
Subject: Re: Cast on character columns in views