当我尝试运行插入语句的存储过程时,我遇到了问题。我得到错误:违反了唯一约束,我不明白为什么因为我将主键设置为序列或自动增量。 这是我的存储过程:
create or replace PROCEDURE SACUVAJCUSTOMERDETAILNADA
(
ID_ OUT CUSTOMERDETAILNADA.ID%TYPE,
FIRSTNAME_ IN CUSTOMERDETAILNADA.FIRSTNAME%TYPE
,LASTNAME_ IN CUSTOMERDETAILNADA.LASTNAME%TYPE
,MAIDENNAME_ IN CUSTOMERDETAILNADA.MAIDENNAME%TYPE
MOTHERSMAIDENNAME_ IN CUSTOMERDETAILNADA.MOTHERSMAIDENNAME%TYPE
)AS
BEGIN
INSERT INTO CUSTOMERDETAILNADA(FIRSTNAME,LASTNAME,MAIDENNAME,MOTHERSMAIDENNAME)
VALUES(FIRSTNAME_,LASTNAME_,MAIDENNAME_,MOTHERSMAIDENNAME_)
RETURNING CUSTOMERDETAILNADA.ID INTO ID_;
END SACUVAJCUSTOMERDETAILNADA;
Thanks in advance for any suggestions!