Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Calling sequence from trigger
Hello,
My question is fairly simple and elementary but unfortunatelly i
don't
know much in PL/SQL.
I wan't the PK of my table to be auto-incremented by one every time i
insert a new record. (like the Autonumber datatype in Access)
So i created a sequence with increment of 1 and then i tried to call
the
sequence from a trigger in a way :
Begin
:new.ColumnName := SequenceName.nextval ;
End ;
I tried BEFORE INSERT and also , AFTER INSERT FOR EAH ROW.
But it doesnt seem to work although when i do "ALTER TRIGGER trigger_name COMPILE " the trigger is valid.
Also if we assume that the trigger finaly works in SQL*PLUS, will it
fire when i insert a new record in an Access form which talks to
Oracle8
via ODBC ?
Or i would have to write an Access event procedure that does the same
job at the client side ?
Thanks a lot...if you can help me with some sample code i would appreciate it.
Alex.
Received on Thu Jan 20 2000 - 20:33:10 CST
![]() |
![]() |