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 24411D8CC7 for ; Wed, 5 Oct 2005 06:43:12 -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 09516-02 for ; Wed, 5 Oct 2005 09:43:08 +0000 (GMT) Received: from xproxy.gmail.com (xproxy.gmail.com [66.249.82.206]) by svr1.postgresql.org (Postfix) with ESMTP id 2A28BD86A4 for ; Wed, 5 Oct 2005 06:43:09 -0300 (ADT) Received: by xproxy.gmail.com with SMTP id i30so73237wxd for ; Wed, 05 Oct 2005 02:43:12 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type; b=kOwGzPCJO1o3JmQ+TG8Ne+1MRiQbkERrJdE+Y5+CXyDsi/wf1jW1fHEZADovHeHiAPp9j7wzkV9y/fVwbWd0faCBTA6kn/thP6XYg70XAFFS4hocU7OuZL7bA2WCCtEEF9JyUaswK/htU5mdEz8JteBENxg699zrGDcaPppbXaA= Received: by 10.70.111.9 with SMTP id j9mr355247wxc; Wed, 05 Oct 2005 02:43:12 -0700 (PDT) Received: by 10.70.126.10 with HTTP; Wed, 5 Oct 2005 02:43:12 -0700 (PDT) Message-ID: <2ad001660510050243u2061cb79pa4fb338e7af6f33a@mail.gmail.com> Date: Wed, 5 Oct 2005 15:13:12 +0530 From: Ninad Kalamkar Reply-To: Ninad Kalamkar To: pgsql-php@postgresql.org Subject: Triggers problem MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_21470_3410762.1128505392155" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.111 required=5 tests=[HTML_40_50=0.086, HTML_MESSAGE=0.001, RCVD_BY_IP=0.024] X-Spam-Level: X-Archive-Number: 200510/10 X-Sequence-Number: 3278 ------=_Part_21470_3410762.1128505392155 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 ------=_Part_21470_3410762.1128505392155 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 inser= ted 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 prob= lems
please guide me in this regards


------=_Part_21470_3410762.1128505392155--