以下是错误消息:
Error starting at line : 207 in command -
INSERT ALL
INTO employees
VALUES
( 777, 'Pereira', 'Daniele',
'x1400', 'name@email.com', '4',
1088, 'Head Cashier' )
INTO employees
VALUES
( 18161884, 'Samuel', 'Rowbotham',
'x6400', 'drsamuelrowbotham@parallax.co.uk', '4',
1088, 'Cashier' )
SELECT * FROM employees WHERE reportsto = 1088
Error report -
ORA-00001: unique constraint (DBS211_202A27.SYS_C001065272) violated即使我禁用了外键约束,也会发生这种情况:
代码:
ALTER TABLE employees
DISABLE CONSTRAINT EMP_RTEMP_FK;
INSERT ALL
INTO employees
VALUES
( 777, 'Pereira', 'Daniele',
'x1400', 'name@email.com', '4',
1088, 'Head Cashier' )
INTO employees
VALUES
( 18161884, 'Samuel', 'Rowbotham',
'x6400', 'drsamuelrowbotham@parallax.co.uk', '4',
1088, 'Cashier' )
SELECT * FROM employees WHERE reportsto = 1088;
ALTER TABLE employees
ENABLE CONSTRAINT EMP_RTEMP_FK;
Table EMPLOYEES altered.
Error starting at line : 207 in command -
INSERT ALL
INTO employees
VALUES
( 777, 'Pereira', 'Daniele',
'x1400', 'name@email.com', '4',
1088, 'Head Cashier' )
INTO employees
VALUES
( 18161884, 'Samuel', 'Rowbotham',
'x6400', 'drsamuelrowbotham@parallax.co.uk', '4',
1088, 'Cashier' )
SELECT * FROM employees WHERE reportsto = 1088
Error report -
ORA-00001: unique constraint (DBS211_202A27.SYS_C001065272) violated
Table EMPLOYEES altered.约束信息:EMP_RTEMP_FK Foreign_Key DBS211_202A27 EMPLOYEES SYS_C001065272 NO ACTION ENABLED NOT DEFERRABLE VALIDATED USER NAME 20-05-26
发布于 2020-06-26 08:08:27
INSERT ALL
INTO employees
VALUES
( 777, 'Pereira', 'Daniele',
'x1400', 'name@email.com', '4',
1088, 'Head Cashier' )
INTO employees
VALUES
( 18161884, 'Samuel', 'Rowbotham',
'x6400', 'drsamuelrowbotham@parallax.co.uk', '4',
1800, 'Cashier' )这是一个RTFQ/长时间工作和变得模糊的案例。第二个值是1800,而不是两者都是1088。这最终起到了作用。
https://stackoverflow.com/questions/62455671
复制相似问题