I have created a table in oracle 220.127.116.11 table name Test columns Id, name. I have anothe table Audit_test
CREATE TABLE AUDIT_TEST (
I have create primay key on the test table like this
ALTER TABLE TEST
ADD CONSTRAINT PK_TEST_ID
EXCEPTIONS INTO AUDIT_TEST;
After that I have tried to insert into Test table with the same Id twice like below
INSERT INTO TEST(TEST_ID, TEST_NAME)
It fails to insert into the record but there is no record in Audit_Test. The way I understood the EXCEPTIONS INTO is when ever there is an exception in inserts the record into AUDIT_TEST table but this is not happing.
Can you let me know what does EXCEPTIONS INTO do and where I am doing wrong.