X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id EE2D6D9181 for ; Sun, 9 Oct 2005 15:07:37 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 09396-02 for ; Sun, 9 Oct 2005 18:07:33 +0000 (GMT) Received: from flake.decibel.org (flake.decibel.org [67.100.216.10]) by svr1.postgresql.org (Postfix) with ESMTP id 80647D8BDB for ; Sun, 9 Oct 2005 15:07:33 -0300 (ADT) Received: by flake.decibel.org (Postfix, from userid 1001) id CAE531524F; Sun, 9 Oct 2005 13:07:33 -0500 (CDT) Date: Sun, 9 Oct 2005 13:07:33 -0500 From: "Jim C. Nasby" To: Ninad Kalamkar Cc: pgsql-php@postgresql.org Subject: Re: Triggers problem Message-ID: <20051009180733.GL16679@pervasive.com> References: <2ad001660510050243u2061cb79pa4fb338e7af6f33a@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2ad001660510050243u2061cb79pa4fb338e7af6f33a@mail.gmail.com> X-Operating-System: FreeBSD 4.11-RELEASE-p10 i386 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.9i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.009 required=5 tests=[AWL=0.009] X-Spam-Level: X-Archive-Number: 200510/13 X-Sequence-Number: 3281 You're more likely to get a response to this on -general than here. Why are you trying to do this with a trigger? ISTM that with what you're trying to do you should be using a stored procedure. On Wed, Oct 05, 2005 at 03:13:12PM +0530, Ninad Kalamkar wrote: > i have a problem in triggers for that bellow is my table structure > > survey table > survey_id > > questions table > question_id > survey_id > > answer_options table > answer_option_id > question_id > > > now the problem is > i want to write a trigger after insert on survey table data should be > inserted in questions and answer options table > i get survey_id by new.survey_id but in same function i am not getting > question_id to insert in answer option for newly inserted questions as the > trigger is on insert of survey table > i don't want to use cascaded triggers because it is creating some more > problems > please guide me in this regards -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461