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
- reimport datas without loosing relations via the keycolumn
- 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