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: Alternatives to Sequences?

Re: Alternatives to Sequences?

From: Klaus Born <KlausBorn_at_caps.de>
Date: Tue, 28 Sep 1999 14:06:22 +0200
Message-ID: <7sqb2r$nu8$1@news03.btx.dtag.de>


i use a trigger which is a little bit different. insted of
> > select foo_sequence.nextval
> > into :new.keycolumn
> > from dual;

i would prefer something like this

if new.keycolumn is null then begin
  select foo_sequence.nextval
  into :new.keycolumn
  from dual;
end

why i do that?
there are 2 things to solve

  1. reimport datas without loosing relations via the keycolumn
  2. if you use Delphi (like me) it could be that you must generate the keycolumn in the Delphi Program using a Stored Procedure and set the value in the after insert event of the table object. This makes shure that delphi know the primary key when you save the record (Delphi Prof not C/S native drivers used). Otherwise the key is only knowed by the server! Because i am new in Oracle (currently tested in Interbase) i doesnt know if this is a must in Oracle nor if this is a must if you use Delphi C/S C++ programers dont laugh, you have more todo when you uses database elements!! Klaus
Received on Tue Sep 28 1999 - 07:06:22 CDT

Original text of this message

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