Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is possible to set or create new session variable ?
Message
 
 
Information générale
Forum:
Oracle
Catégorie:
Autre
Divers
Thread ID:
00425170
Message ID:
00425251
Vues:
14
This is how I setup a trigger and equence for my tables:
create sequence s_npdes_WB_PARMS   increment by 1 start with 1 nocache;

create or replace trigger WB_PARMS_BEFORE_INSERT
 BEFORE INSERT ON NPDES.WATERBODY_PARMS FOR EACH ROW
DECLARE
 v_Id    Number;
BEGIN
 :new.Updated_By  := USER;
 :new.Last_Update := SYSDATE;
 IF :new.KeyID Is Null or :new.KeyID < 1 THEN
    select s_npdes_WB_PARMS.nextval into v_Id from dual;
    :new.KeyID := v_Id;
 END IF;
END;
/

create public synonym WATERBODY_PARMS  for NPDES.WATERBODY_PARMS;
create public synonym S_NPDES_WB_PARMS for NPDES.S_NPDES_WB_PARMS;
You do need public synonyms for sequences as well.
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform