1z0144 Oracle Database 11g: Program with PL/SQL Free Practice Test — 29 Questions

29 questions · Full explanations · No account required

Free
Question 1 of 29

Consider a PL/SQL procedure named `update_customer_status` designed to manage customer records. This procedure utilizes a `MERGE` statement to update a customer\'s status to \'ACTIVE\' if their `last_login_date` is within the past 30 days, or insert a new record with a status of \'INACTIVE\' if the customer does not exist. However, due to a programming oversight, the `customer_id` column, which has a `NOT NULL` constraint, is being passed as NULL in the `WHEN NOT MATCHED THEN INSERT` clause of the `MERGE` statement. If the procedure is executed with a `customer_id` that does not exist in the `customers` table, which PL/SQL construct is the most suitable for catching the resulting constraint violation and preventing an unhandled exception, allowing for controlled error management?

An EXCEPTION block with a WHEN OTHERS handler
A cursor FOR loop with an explicit exception handler for NO_DATA_FOUND
A subquery within the MERGE statement to pre-validate customer existence
A PRAGMA EXCEPTION_INIT to assign a custom name to the constraint violation error

About the 1z0144 Oracle Database 11g: Program with PL/SQL Certification

These free practice questions are designed to help you assess your readiness for the 1z0144 Oracle Database 11g: Program with PL/SQL exam by Other. Each question comes with a detailed explanation to reinforce the correct concept. For a complete exam preparation experience with hundreds of questions, spaced-repetition study tools, and full exam simulations, explore our premium access.