0
CREATE OR REPLACE TRIGGER  "BI_QUIZQUES" 
  before insert on "QUIZQUES"               
  for each row  
begin   
    :NEW.QID := "QUIZQUES_SEQ".nextval; 
end; 

/
ALTER TRIGGER  "BI_QUIZQUES" ENABLE
/
1
  • 1
    Could you expand a bit on what your question is? What have you tried? What is going wrong? Are you getting an error, and if so, what error? etc.. Commented Dec 11, 2019 at 8:15

1 Answer 1

1

The trigger does just the same as an autoincrement in mysql, so add autoincrement to the QID field in your table definition.

QID is probably a primary key in your table.

create table QUIZQUES (
QID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
...
)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.