Re: Sequences in Triggers

From: <ga11742_at_pop.iperbole.bologna.it>
Date: Sun, 13 Dec 1998 01:42:31 +0100
Message-ID: <36730D77.34095E25_at_pop.iperbole.bologna.it>


Greg Williams ha scritto:

> How would I assign a sequence to an item when a button is pressed?
> I know it needs a when button pressed trigger, and I've already created
> the sequence
> (starts with 1000, increments by 1). But I can't figure out how to
> assign it.
>
> And is it even possible to assign a sequence to a list item?
>
> Steve Karam
> steve-karam_at_lambdaconsulting.com

 1)

In your "when-button-pressed" trigger you have to use the following instruction :

"SELECT <sequence_name>.NEXTVAL INTO <:item_name> FROM dual"

  • "NEXTVAL" will generate for you a new and unique value;
  • If you need the last generated value, use "CURRVAL" instead of "NEXTVAL";

  Attention, "CURRVAL" returns you the last generated value FOR YOUR SESSION:
  before a "CURRVAL" you MUST generate a "NEXTVAL".

2)
Assign a sequence to a list item ? Excuse me but I cannot understand what do you want to do.

Hi Received on Sun Dec 13 1998 - 01:42:31 CET

Original text of this message