Have you wondered ever? What will happen if users are trying to insert duplicate records in a SET table. Lets try to check the same with a simple example.
Sample Table: Creating a SET table
CREATE SET VOLATILE TABLE tutorial_test_set
(
id INTEGER
)
PRIMARY INDEX(id)
ON COMMIT PRESERVE ROWS;
INSERT INTO tutorial_test_set VALUES(1);
Output:
*** Insert completed. One row added.
INSERT INTO tutorial_test_set VALUES(1);
Output:
*** Failure 2802 Duplicate row error in tutorial_test_set.