Received: from lh00.opsion.fr (lh00.opsion.fr [212.73.208.226]) by postgresql.org (8.11.3/8.11.4) with SMTP id fAQ1f7m27174 for ; Sun, 25 Nov 2001 20:41:08 -0500 (EST) (envelope-from cnliou@eurosport.com) Received: from 10.1.1.8 [10.1.1.8] by lh00.opsion.fr; Mon, 26 Nov 2001 01:40:53 GMT Send-By: 203.66.130.107 with Mozilla/4.78 [en] (Win95; U) To: Subject: Exception When Insert Followed By Delete In PL/PGSQL From: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Date: Mon, 26 Nov 2001 01:40:53 GMT Message-id: <200111260140.35e7@lh00.opsion.fr> Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by postgresql.org id fAQ1hqL27212 X-Archive-Number: 200111/361 X-Sequence-Number: 5743 Hello! The exception is raised by PL/PGSQL in version PostgreSQL 7.1.3.: triggered data change violation on relation "mastertable" The code having problem: DECLARE n smallint; BEGIN insert into MasterTable values...; SELECT COUNT(*) INTO n FROM DetailTable,MasterTable WHERE DetailTable.KeyField = MasterTable.KeyField; IF n = 0 THEN DELETE FROM MasterTable WHERE ...; --exception raised END IF; END; -------------------------------------------------------- You too can have your own email address from Eurosport. http://www.eurosport.com