Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is possible to set or create new session variable ?
Message
 
 
To
05/10/2000 01:47:55
General information
Forum:
Oracle
Category:
Other
Miscellaneous
Thread ID:
00425170
Message ID:
00425251
Views:
15
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform