Re: I can't find the right trigger

From: Joost Bataille <bataille_at_ic.uva.nl>
Date: Wed, 3 Jan 2001 10:15:29 +0100
Message-ID: <92uqjh$447$1_at_mail.ic.uva.nl>


Hello Jerome,
you wrote
> Thanks for your help but I think you do not understand my problem (maybe I
> give you bad explain).
> My problem is *NOT* to create the record in table B.
> The matter is to know wich value will have my sequencial column in table
 A.
> When forms commit my record in table A, it fires a table-trigger that call
 a
> sequence (SELECT seq_A.NEXTVAL into :NEW.Code FROM dual) to fill the
 column.
> I need to insert that value in table B. In a when-validate-record trigger
 on
> block A, this value is not known yet by forms and this is my problem.
> Am I clearer ?
Yes, you are.
[Quoted] I think you can use a post-insert trigger. It fires after the insert in table A so you can query table A for the value that has just been inserted [Quoted] in the code column. There's your value. Then you write an insert statement for your insert into table B.

Another possibility:
[Quoted] Drop or disable the trigger on the table. If you have a screen item 'code' then in the pre-insert trigger you write: [Quoted] select seq_A.nextval into l_code from dual; :code := l_code;
Then you have your sequence value in l_code.

[Quoted] I think I'd prefer the first option.
Good luck, Joost Received on Wed Jan 03 2001 - 10:15:29 CET

Original text of this message