如何在oracle 10g中的主键中插入空值

时间:2013-12-22 07:54:03

标签: oracle

CREATE TABLE  "QUIZQUES" 
   (    "QUESTION" VARCHAR2(4000), 
    "OPTION1" VARCHAR2(4000), 
    "OPTION2" VARCHAR2(4000), 
    "OPTION3" VARCHAR2(4000), 
    "OPTION4" VARCHAR2(4000), 
    "ANSWER" VARCHAR2(4000), 
    "QUIZNAME" VARCHAR2(4000), 
    "QID" VARCHAR2(4000), 
    "DESCRIPTION" VARCHAR2(4000), 
     CONSTRAINT "QUIZQUES_PK" PRIMARY KEY ("QID") ENABLE
   )
/

CREATE OR REPLACE TRIGGER  "BI_QUIZQUES" 
  before insert on "QUIZQUES"               
  for each row  
begin   
    select "QUIZQUES_SEQ".nextval into :NEW.QID from dual; 
end; 
***************

这里我试图将空值插入QID,但在myeclipse中显示ORA-04098:

  

触发'SYSTEM.BI_QUIZQUES'无效且重新验证失败

0 个答案:

没有答案