Re: How to use sequences, and which trgger for "Execute_Querry'?

From: Stefan Kursawe <skursawe_at_earthlink.net>
Date: Tue, 03 Oct 2000 18:56:11 GMT
Message-ID: <fZpC5.12794$TP6.213479_at_newsread2.prod.itd.earthlink.net>


Hi Richard,

    have your tried the PRE_INSERT Trigger ?

    SELECT <SEQUENCE_NAME>.NEXTVAL INTO :<DATABLOCK>.<ID_COLUMN>;

HTH
    Stefan

[Quoted] "Richard Hollingsworth" <william.hollingsworth_at_hsv.boeing.com> wrote in message news:39D9FC2B.8EAF6817_at_hsv.boeing.com...
> Hi. Thanks for reading this.
>
> I have a sequence defined, and want it to increment by 1 each time I add
> a new record. Well, what happens is, when the form comes up, no records
> are visible. I have to manually press the 'execute_querry' button to
> get the old records to show up. When I do that, the records appear, but
> the sequence number has now doubled. Also, each time I press the "next"
> or "previous" record button to review the old records, the sequence
> increments.
>
> So I think I have the "select cr_seq.nextval into
> :change_request.cr_number from dual;" statement on the wrong trigger.
> Which one should it be on? I have it on the "WHEN-NEW-RECORD-INSTANCE"
> trigger for the block. I also tried the "WHEN-NEW-BLOCK-INSTANCE"
> TRIGGER. Same results.
>
> Also, where does the "EXECUTE_QUERRY" command go so it will auto. load
> the old records for the table when the form appears?
>
> Thanks,
> Richard Hollingsworth
>
>
>
Received on Tue Oct 03 2000 - 20:56:11 CEST

Original text of this message