Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 32DEA9F95D8 for ; Tue, 4 Sep 2007 01:08:41 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 45767-06 for ; Tue, 4 Sep 2007 01:08:39 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from web54305.mail.re2.yahoo.com (web54305.mail.re2.yahoo.com [206.190.49.115]) by postgresql.org (Postfix) with SMTP id D53C69F95C8 for ; Tue, 4 Sep 2007 01:08:38 -0300 (ADT) Received: (qmail 21578 invoked by uid 60001); 4 Sep 2007 04:08:37 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=jD1i6hVIRDjBf0j9cfcaMxLl5jLKuSlOejujRqoxDq+QLpxB9iBIomAydjWtAcpVNVKv/EKLCfKZhPP401uu4FDaB+WFRD6q8Q++yJJJyLpWcsdJ4JGXz6JmoBXHw4ydi/ODKgbffWOjcZGoBJ3klJxZhWeG71mUPzx/mJ9zc9o=; X-YMail-OSG: horCe98VM1kL95uKgotFo_EC3FdpoNz_P.3mUOK_HJWrSxso8lU0oSiel5anMJuwyR0pzO4ZhqQJMJyxBXZ3Hv2l99dvwkuR6vPYvPKnfWhmHRYWrY8zGaz2LlK5mg-- Received: from [69.108.235.25] by web54305.mail.re2.yahoo.com via HTTP; Mon, 03 Sep 2007 21:08:37 PDT Date: Mon, 3 Sep 2007 21:08:37 -0700 (PDT) From: chester c young Subject: Re: Execute SQL statements with 'context'/predefined variables To: blay bloo Cc: sql pgsql In-Reply-To: <66c468170709031734o80d8e2o92f18d23ac5b8c72@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <577132.21411.qm@web54305.mail.re2.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/16 X-Sequence-Number: 29229 ... > 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