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 -> Calling sequence from trigger

Calling sequence from trigger

From: Alexandros Kotsiras, NYC <alexandros_k_at_prodigy.net>
Date: Thu, 20 Jan 2000 21:33:10 -0500
Message-ID: <3887C565.D8A4B014@prodigy.net>


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

Original text of this message

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