Couples


Oracle PL/SQL Exceptions Language features Public New

Easy  

2min


Consider the following table definition:

CREATE TABLE couples(
  id NUMBER PRIMARY KEY NOT NULL,
  first_name VARCHAR2(50) NOT NULL,
  last_name VARCHAR2(50) NOT NULL
);

Later the following code is executed:

DECLARE
  husband_id NUMBER;
BEGIN
  SELECT id INTO husband_id FROM couples WHERE first_name = 'John' AND last_name = 'Johnson';
  INSERT INTO couples(id, first_name, last_name) VALUES(husband_id + 1, 'Jane', 'Johnson');
END;

Select all the exceptions that might be raised.