From: Jim C. Nasby <jnasby@pervasive.com>
To: Ninad Kalamkar <ninadk@gmail.com>
Cc: pgsql-php@postgresql.org
Subject: Re: Triggers problem
Date: Sun, 9 Oct 2005 13:07:33 -0500
Message-ID: <20051009180733.GL16679@pervasive.com> (raw)
In-Reply-To: <2ad001660510050243u2061cb79pa4fb338e7af6f33a@mail.gmail.com>
References: <2ad001660510050243u2061cb79pa4fb338e7af6f33a@mail.gmail.com>
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
> <pgsql-php@postgresql.org>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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-php@postgresql.org
Cc: jnasby@pervasive.com, ninadk@gmail.com
Subject: Re: Triggers problem
In-Reply-To: <20051009180733.GL16679@pervasive.com>
References: <2ad001660510050243u2061cb79pa4fb338e7af6f33a@mail.gmail.com> <20051009180733.GL16679@pervasive.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox