Received: from www.lighthouseasp.com (host-100.lighthouseasp.com [216.191.176.100] (may be forged)) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f0QKQfq44426 for ; Fri, 26 Jan 2001 15:26:41 -0500 (EST) (envelope-from cbell@lighthouseasp.com) Received: from lighthouseasp.com ([216.191.139.105]) by www.lighthouseasp.com (8.9.3/8.8.7) with ESMTP id PAA03191 for ; Fri, 26 Jan 2001 15:26:37 -0500 Message-ID: <3A71DD77.308C8E2A@lighthouseasp.com> Date: Fri, 26 Jan 2001 15:26:31 -0500 From: cbell X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.2.14-5.0 i686) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-interfaces@postgresql.org Subject: obtaining results from trigger Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200101/301 X-Sequence-Number: 925 Hello everyone, I was hoping someone could help me with this... I'm running postgres 7.02 on redhat 6.2, apache 1.3.14 and mod_perl 1.24_01. I'm also using perl modules DBI 1.14 and DBD-Pg-0.95 to acces the Postgres database. Everytime my inventory file gets updated, I would like to have the quantity on hand returned to my perl script. I set up the following function to do this: CREATE FUNCTION inv_lookup () RETURNS OPAQUE AS ' BEGIN RAISE NOTICE ''%'', NEW.qtyonhand; RETURN new; end; 'language 'plpgsql'; Then I create the trigger like this... CREATE TRIGGER qty after inventory for each row execute procedure inv_lookup(); If I do any sort of updates from within psql I get the correct data which is the Qtyonhand field in this format: NOTICE: 15 However, in my perl program, I'm unsure as to how to get this information back. The Postgres Documentation says that the results from a Notice get sent back to the application, but I check the DBI->err, DBI->errstr, and DBI->state and they are empty. The result code for the actual SQL command I run is just 1 for success. Does anyone know how to get these results from within a perl scripts??? Thanks in advance for any help. Chris.