Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: SEQUENCE

Re: SEQUENCE

From: Scott Cote <scottcotexy_at_contractor.net>
Date: Tue, 21 Jul 1998 11:54:15 -0500
Message-ID: <35B4C7B7.27D34AB3@contractor.net>


Barry,

As a DBA, I generally do not like to give access to sequences to the developers, so I utilize triggers (this is only a rule of thumb - not a law implying that I do make exceptions).

SCott

Barry Jones wrote:

> Using your example, could you not use
>
> insert into muffel (spalte1,spalte2) values (seq.muffel.nextval,'one');
>
> without the need for a before trigger.
>
> Barry Jones
> Logica UK Ltd.
>
> Lothar Armbrüster <lothar.armbruester_at_rheingau.netsurf.de> wrote in article
> <846.500T1187T11973314_at_rheingau.netsurf.de>...
> > On 15-Jul-98 13:41:04 John Bester wrote:
>
> > create or replace trigger tib_muffel before insert on muffel
> > for each row
> > begin
> > select seq_muffel.nextval into :new.spalte1 from dual;
> > end;
> > /
> >
> > Then you can do the inserts:
> >
> > insert into muffel (spalte2) values ('test');
> > insert into muffel (spalte2) values ('two');
> >
> > Hope that helps,
> > Lothar
> >
> > --
> > Lothar Armbrüster | lothar.armbruester_at_rheingau.netsurf.de
> > Schulstr. 12 | lothar.armbruester_at_t-online.de
> > D-65375 Oestrich-Winkel |
> >
> >


Received on Tue Jul 21 1998 - 11:54:15 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US