PLSQL Procedure in Erlang
Functions/Procedures from Erlang: Prepare your DB: drop table employee; CREATE TABLE EMPLOYEE ( "NR" NUMBER, "FIRSTNAME" VARCHAR2(20), "LASTNAME" VARCHAR2(20), "GENDER" CHAR(1), "EXPERIENCE" NUMBER ) ; ALTER TABLE EMPLOYEE ADD PRIMARY KEY ("NR"); DROP SEQUENCE EMPLOYEE_SEQ; CREATE SEQUENCE EMPLOYEE_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 9999999999999999999999999999 MINVALUE 1 CACHE 20; create or replace TRIGGER EMPLOYEE_SEQ_TRG BEFORE INSERT ON EMPLOYEE FOR EACH ROW BEGIN <<COLUMN_SEQUENCES>> BEGIN IF INSERTING AND :NEW.NR IS NULL THEN SELECT EMPLOYEE_SEQ.NEXTVAL INTO :NEW.NR FROM SYS.DUAL; END IF; END COLUMN_SEQUENCES; END; insert into EMPLOYEE(FIRSTNAME, LASTNAME, GENDER, EXPERIENCE) values ('Richa','Vaidya','F',4); select * from EMPLOYEE; and check the output. Lets create a procedure for inserting: ...