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

From: Richard Hollingsworth <william.hollingsworth_at_hsv.boeing.com>
Date: Wed, 4 Oct 2000 16:16:00 GMT
Message-ID: <39DB57C0.260EC723_at_hsv.boeing.com>


Matt:

[Quoted] I don't know if this will get to you or not, never replied to a sender before.

[Quoted] [Quoted] What I want to do is, when the user enters the form, it takes them to the "NEXT" blank record, and shows the new sequence number in the CR_NUMBER field. Each time [Quoted] [Quoted] the user presses the INSERT_KEY on the toolbar, I want to create a new blank record [Quoted] and increment the sequence number and display it in the CR_NUMBER field.

[Quoted] I'm guessing that this is kinda the standary interface a user would want to see [Quoted] [Quoted] when entering a new form - to see the new cr_number (non-editable of course) and [Quoted] then start entering data.

[Quoted] Thanks for the reply and any help you might have.

Thanks again,
Richard Hollingsworth

"Matt B." wrote:

> "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.
>
> Standard functionality.
>
> >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.
>
> That's because you have it in WHEN-NEW-RECORD-INSTANCE. As you land on another
> record, it fires.
>
> > 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.
>
> Depends on when you want to do it - can you be more specific? Do you want it
> for every record you commit to the database? Try POST-INSERT then. Do you
> want it for every record you enter even if you don't commit them? Then do it
> on WHEN-NEW-RECORD-INSTANCE with a "IF :SYSTEM.RECORD_STATUS = 'NEW'" condition
> around it. Or when you leave a record and go to another one? Try POST-RECORD
> or WHEN-VALIDATE-RECORD (depending on what you want) with a "IF
> :SYSTEM.RECORD_STATUS = 'INSERT'" condition.
>
> Any other way you want to do it?
>
> > Also, where does the "EXECUTE_QUERRY" command go so it will auto. load
> > the old records for the table when the form appears?
>
> WHEN-NEW-FORM-INSTANCE is a good place if your first navigable block is the one
> you want. Otherwise, preface it with a go_block(<blockname>); first before you
> execute the query.
>
> -Matt
Received on Wed Oct 04 2000 - 18:16:00 CEST

Original text of this message