Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: ???? creating key by itself ??????
You could create a database trigger.
Rough example follows:
create or replace trigger mytable_bier
before insert on mytable
for each row
begin
declare cursor mseq is
select mytable_seq.nextval from dual ;
begin
if :new.pk is null then
open mseq ; fetch mseq into new.pk ; close mseq ;
ido (ilepper_at_fac.fbk.eur.nl) wrote:
: I am using Delphi to work on my Tables wich are controlled by Oracle DBMS.
: The tables where created using Designer/2000.
: Ok my problem is, is it possible to let Oracle generate unique keys when
: inserting a record, so I don't have to do this in Delphi??
: Anyway thanks,
: Ido de Lepper
: ilepper_at_fac.fbk.eur.nl
-- This posting represents the personal opinions of the author. It is not the official opinion or policy of the author's employer. Warranty expired when you opened this article and I will not be responsible for its contents or use.Received on Fri Jul 18 1997 - 00:00:00 CDT