I'm using oracle 11g xpress. I have created a simple table. I want that field each time a user inputs data to be incremented by 1, starting from 10000. Can you assist?
My table is this:
CREATE TABLE PROG_TITLE
(
PR_ID INT NOT NULL,
PR_TITLE VARCHAR2(128) NULL,
PR_INDEX INT NULL
);
I have added the primary key:
ALTER TABLE PROG_TITLE
ADD (CONSTRAINT mykey PRIMARY KEY (PR_ID));
And the sequence:
CREATE SEQUENCE PR_ID START WITH 10001 INCREMENT BY 1;
Now I can insert values as below (and it works):
INSERT INTO PROG_TITLE
(PR_ID, PR_TITLE, PR_INDEX)
VALUES
(PR_ID.NEXTVAL, 'TEST1', 0);
My question is how can I do it without using NEXTVAL? How could I edit my query as to insert values only for PR_TITLE and PR_INDEX?