Oracle PL/SQL is Oracles extension for SQL and Oracle relational database. Oracle PL/SQL adds support for procedural language features such as control statements, loops and classes. This allows the developer to further optimize and refine queries at the database, rather than application layer.
Exceptions exist in most modern programming languages, making it important for a programmer to understand them and know how to handle them.
Knowing the most important features of a programming language is necessary for the effective use of many parts of the framework as well as keeping the code readable.
Public questions (free account) are common interview questions. They are great for practicing, or if you want to filter candidates using the classic problems.
This is a part of latest question addition to our question library.
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.
(multiple correct answers possible)