Oke, last time I posted I asked about creating a trigger. Now I have the next problem. I'm trying to create an automatic patientnumber in the next view.
CREATE VIEW V_PATIENT AS
SELECT PATIENTNUMBER
, FIRSTNAME
, LASTNAME
, STREET
, HOUSENUMBER
, POSTALCODE
, CITY
, PHONENUMBER
, BIRTHDATE
FROM PATIENT;
I created the next sequence:
create sequence autonummer
INCREMENT BY 1
START WITH 1
MINVALUE 1
MAXVALUE 999999999999999999999999999
NOCYCLE
NOORDER
NOCACHE;
What I'd really like to know is how I can use this sequence in a trigger to create an automatic patientnumber.