Hey everyone i'm trying to set up the following table for a registration page for a website using oracle im having problem with triggers heres my code:Create Table:CREATE TABLE Users ( User_id NUMBER NOT NULL, UserName VARCHAR2(25), Password VARCHAR2(25), Email VARCHAR(50), Phone NUMBER(10), Full_Name VARCHAR2(50), Address VARCHAR2(100), Primary key (User_id) );
Heres the Sequence CREATE SEQUENCE Users_sequenceSTART WITH 1INCREMENT BY 1;
Heres the trigger:CREATE OR REPLACE TRIGGER Users_triggerBEFORE INSERTON USERSREFERENCING NEW AS NEWFOR EACH ROWBEGINSELECT Users_sequence.nextval INTO :NEW.users_id FROM dual;END;/
Now the error i get is: ERROR at line 1:ORA-04082: NEW or OLD references not allowed in table level triggersanyhelp will be much appreciated :)