Re: Execute SQL statements with 'context'/predefined variables

From: chester c young <chestercyoung(at)yahoo(dot)com>
To: blay bloo <blaybloo(at)googlemail(dot)com>
Cc: sql pgsql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Execute SQL statements with 'context'/predefined variables
Date: 2007-09-04 04:08:37
Message-ID: 577132.21411.qm@web54305.mail.re2.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Broersma Jr 2007-09-04 04:23:59 Re: Cast on character columns in views
Previous Message Luiz K. Matsumura 2007-09-04 03:44:44 Cast on character columns in views