pl sql auto increment

Solutions on MaxInterview for pl sql auto increment by the best coders in the world

showing results for - "pl sql auto increment"
Yannic
13 May 2016
1CREATE TABLE departments (
2  ID           NUMBER(10)    NOT NULL,
3  DESCRIPTION  VARCHAR2(50)  NOT NULL);
4
5ALTER TABLE departments ADD (
6  CONSTRAINT dept_pk PRIMARY KEY (ID));
7
8CREATE SEQUENCE dept_seq START WITH 1;
9
Carolyn
16 May 2018
1CREATE OR REPLACE TRIGGER dept_bir 
2BEFORE INSERT ON departments 
3FOR EACH ROW
4
5BEGIN
6  SELECT dept_seq.NEXTVAL
7  INTO   :new.id
8  FROM   dual;
9END;
10/
11
similar questions
queries leading to this page
pl sql auto increment