Limited-Time Offer: Enjoy 50% Savings! - Ends In 0d 00h 00m 00s Coupon code: 50OFF
Welcome to QA4Exam

Free practice questions with explanations

Oracle 1Z0-149 Dumps 2026 with Free Practice Questions and Answers

15 original practice questions for the Oracle Database 19c: Program with PL/SQL exam, each with an answer and explanation.

Exam topics: Creating Compound, DDL, And Event Database Triggers, Creating Functions, Creating Packages, Creating Procedures And Using Parameters and 11 more.

Formats: single answer, dropdown, multiple answers, drag and drop and order list. A new question is added every 15 days.

1Z0-149 Practice Set Details

Vendor
Oracle
Exam Code
1Z0-149
Questions On This Page
15
Exam Topics Covered
15 of 18
Question Types
5
Newest Question
New Question
Every 15 days
Full Question Set
65
Certification
Oracle PL/SQL Developer Certified Professional
15 questions

Oracle 1Z0-149 Exam Questions and Answers by Topic

Declaring PL/SQL Variables

1 practice question on this topicWhat this topic covers

Question 1

Added

Dropdown

A maintenance procedure selects a value from EMPLOYEES and stores a complete employee row for subsequent field-level checks. The team wants both declarations to adapt when the underlying column type or table row shape changes. Complete the declaration by selecting the appropriate attributes.

Choose the correct value for each blank.

l_salary employees.salary; l_employee employees;
Correct answer:

l_salary employees.salary%TYPE; l_employee employees%ROWTYPE;

employees.salary%TYPE anchors the scalar variable to the declared type of the salary column, so a compatible column type change is reflected in the declaration. employees%ROWTYPE declares a record with fields corresponding to the table's row structure. Using %ROWTYPE for a scalar column would produce a record rather than a scalar. Using %TYPE for the table name is invalid because %TYPE anchors to a scalar variable or column declaration. The other proposed attributes are not valid PL/SQL declaration attributes.

Writing SQL in PL/SQL

1 practice question on this topicWhat this topic covers

Question 2

Added

Single Answer

A service allocates a new invoice identifier from a sequence, inserts the invoice header, and must return both the generated identifier and the inserted row's creation timestamp to PL/SQL. The insert is part of the caller's transaction, and the developer wants to avoid a second query that could observe a different state. Which approach is best?

Correct answer: C

NEXTVAL supplies the new sequence value in the insert, and DML RETURNING INTO can place values from the inserted row into PL/SQL variables in the same statement. This avoids a second query and leaves transaction control with the caller. CURRVAL is only available after NEXTVAL has been referenced in the session, and the separate query is unnecessary. Committing violates the caller-owned transaction constraint. SQL%ROWCOUNT reports the number of affected rows, not column values.

Writing Control Structures

1 practice question on this topicWhat this topic covers

Question 3

Added

Single Answer

A data-quality routine scans daily measurements in chronological order. It must stop processing once a measurement exceeds a hard safety limit, skip individual measurements marked as maintenance readings, and otherwise accumulate the valid values. The query returns rows in the required order, and the routine must not use exception handling for normal control flow. Which loop structure best expresses this behavior?

Correct answer: B

A cursor FOR loop fetches the ordered query rows and closes the cursor automatically. EXIT terminates the loop when the hard limit is encountered, while CONTINUE skips the remainder of the current iteration for a maintenance row. The WHILE alternative reverses the required EXIT and CONTINUE behavior and adds unnecessary manual fetch control. Raising exceptions for expected maintenance data is poor control flow and checking the limit after accumulation violates the safety requirement. CONTINUE advances to the next iteration; it does not terminate the loop.

Working with Composite Data Types

1 practice question on this topicWhat this topic covers

Question 4

Added

Single Answer

A nightly reconciliation loads a variable number of account rows into memory and needs to retain all selected columns for each account. The program accesses entries by integer position, may add entries as it processes results, and does not need SQL storage or collection methods beyond those supported by a PL/SQL associative array. The table's columns may change over time, so the row structure should track the table definition. Which declaration is best?

Correct answer: C

A record based on accounts%ROWTYPE tracks the table row shape, and an associative array indexed by PLS_INTEGER provides an in-memory, integer-indexed collection of those records. Entries can be added without specifying a fixed maximum size. A VARRAY has a declared limit and does not meet the requested integer-indexed associative-array design. A nested table of only identifiers loses the requested row data unless parallel structures are maintained. Separate scalar associative arrays risk misalignment and do not represent each account as one row record.

Using Explicit Cursors

1 practice question on this topicWhat this topic covers

Question 5

Added

Multiple Answers

A billing batch must process eligible invoice rows one at a time because each row requires a PL/SQL validation step before its status is changed. The batch must lock the selected rows so that another session cannot change them between validation and update, and it must update the exact row fetched without repeating the selection predicate. The query may return no rows, and the transaction owner, not this routine, decides when to commit. Which two features should the developer use? (Choose two.)

Correct answer: C, D

A cursor declared FOR UPDATE locks its result rows as they are fetched, supporting the required validation-to-update interval. WHERE CURRENT OF identifies the current row of that cursor without rebuilding the predicate. A cursor FOR loop also handles the empty result naturally, but it does not by itself provide the required explicit locking clause. NOWAIT changes lock-wait behavior and committing per row violates transaction ownership. SQL%ROWCOUNT is a row count, not a row identifier, and a later UPDATE cannot retroactively lock rows through an ordinary cursor.

Handling Exceptions

1 practice question on this topicWhat this topic covers

Question 6

Added

Multiple Answers

A stock reservation procedure inserts a reservation and then decrements inventory. The procedure must not leave the reservation behind if the inventory update fails, but it must preserve the original exception and let the caller decide how to report or retry. No autonomous logging is required, and the procedure must not commit. Which two actions satisfy the requirements? (Choose two.)

Correct answer: A, B

A savepoint lets the procedure undo its own work since that point without rolling back earlier caller work. RAISE in the exception handler propagates the current exception and preserves its original identity and backtrace. Replacing all failures with a generic application error loses the original exception details. Committing after the insert would make the partial operation durable and interfere with caller transaction control. Returning normally without rollback reports success while leaving inconsistent data.

Creating Procedures and Using Parameters

1 practice question on this topicWhat this topic covers

Question 7

Added

Single Answer

A payroll application calls a procedure that can update several employee rows. The procedure accepts an optional department identifier and an output count, and its callers use named notation so that a new optional parameter can be added later without changing their calls. The implementation must return the count even when no rows qualify, while unexpected database errors must remain visible to the caller. Which implementation best meets these requirements?

Correct answer: C

A defaulted IN parameter can be omitted in a named-notation call, and an OUT parameter should be assigned on every normal return path. Initializing the count to zero covers the no-row case; assigning SQL%ROWCOUNT after the DML provides the actual affected-row count. Allowing unexpected exceptions to propagate preserves diagnostic information. Giving an OUT parameter a default is not the substitute for assigning it. Reading SQL%ROWCOUNT before DML reports a prior statement's result, and suppressing every error would hide failures. Committing in a reusable procedure also takes transaction control away from its caller.

Creating Functions

1 practice question on this topicWhat this topic covers

Question 8

Added

Single Answer

A schema-owned function computes a discount from a customer's current account status and is called from SQL statements in the application. The function reads tables but performs no DML, transaction control, or other side effects. It must be removable independently without dropping unrelated package routines, and callers need the value as part of a SQL expression. Which implementation choice best fits these requirements?

Correct answer: A

A standalone function returns a value and can be used in a SQL expression when its implementation meets SQL-invocation restrictions. It can also be dropped independently, as required. Procedures do not return a function value for use in a SELECT expression and cannot be called directly as scalar expressions. An autonomous transaction is unnecessary and introduces transaction behavior unrelated to a read-only calculation. DETERMINISTIC does not turn a procedure into a function or make it a scalar SQL expression.

Creating Packages

1 practice question on this topicWhat this topic covers

Question 9

Added

Single Answer

A reporting package must expose a procedure to clients while hiding helper routines. Two functions named total_value are needed: one accepts a department number and the other accepts a department name. Both are required to return NUMBER, and their parameter types distinguish the calls. The package body needs to call a helper that is defined later in that body. Which package design is valid?

Correct answer: D

Public overloads must appear in the package specification, and distinct parameter types allow Oracle to resolve the two calls. A helper can remain private in the body; a forward declaration makes its signature known before an earlier call. Body-only subprograms are not part of the public package interface, and a synonym does not expose them. A forward declaration does not promote a body-only routine into the specification. Overloading cannot be distinguished by local variable names when parameter profiles are identical.

Using Dynamic SQL

1 practice question on this topicWhat this topic covers

Question 10

Added

Order List

A maintenance utility receives a table name and a list of values at runtime, then inserts a row into the named table. The table name comes from an allow-listed configuration table, while the values must be bound rather than concatenated to avoid injection and repeated parse overhead. The utility uses Native Dynamic SQL and has already validated that the table name is an allowed identifier. Arrange the implementation steps in the order they must be performed.

Drag the steps into the correct order, or use the arrows.

  1. Confirm that the bind values correspond to the placeholders
  2. Validate the table identifier against the allow-list
  3. Construct the INSERT text using the validated table identifier and bind placeholders
  4. Call EXECUTE IMMEDIATE with the INSERT text and USING values
Correct answer:
  1. Construct the INSERT text using the validated table identifier and bind placeholders
  2. Call EXECUTE IMMEDIATE with the INSERT text and USING values
  3. Validate the table identifier against the allow-list
  4. Confirm that the bind values correspond to the placeholders

Validation must precede construction so untrusted identifier text is never inserted unchecked into SQL; identifiers cannot be supplied through ordinary bind placeholders. The statement is then assembled with placeholders, and the USING clause supplies values in placeholder order when EXECUTE IMMEDIATE runs it. Constructing before validation risks injection. Executing before confirming placeholder correspondence can raise a bind mismatch. Bind values are passed at execution, not incorporated into the SQL text.

Design Considerations for PL/SQL Code

1 practice question on this topicWhat this topic covers

Question 11

Added

Single Answer

An order-processing package writes a diagnostic record when a business operation fails. The diagnostic must survive a rollback of the caller's transaction, but the diagnostic routine must not commit or roll back the caller's work. The application team also requires the routine to remain a normal stored PL/SQL subprogram and does not want a separate logging service. Which design meets these requirements?

Correct answer: C

An autonomous transaction is independent of the caller's transaction, so its committed diagnostic row survives rollback of the business transaction. Its commit applies to the autonomous transaction rather than committing the caller's work. AUTHID affects privilege checking and does not create transaction independence; a commit in an ordinary subprogram commits the caller's transaction. DETERMINISTIC concerns function result consistency and is unsuitable as a mechanism for persistent side effects. NOCOPY is a parameter-passing hint, and a caller rollback would undo an ordinary diagnostic insert.

Creating Compound, DDL, and Event Database Triggers

1 practice question on this topicWhat this topic covers

Question 12

Added

Single Answer

A security team needs to record every successful CREATE, ALTER, or DROP statement executed in the database, regardless of which schema issued it. The audit record must include the event type, object information, and session identity. Application schemas must not need individual triggers, and the trigger must not attempt to audit statements that fail before completing. Which trigger design is most appropriate?

Correct answer: C

A database-level AFTER DDL trigger can cover DDL events across schemas and can use the event attributes provided to the trigger to record event and object context. AFTER timing means the event has completed successfully before the trigger runs. A schema-level trigger is limited to its schema, and querying dictionary views from an object trigger is not a substitute for a DDL event trigger. Dictionary views are not row-trigger targets. A logon trigger occurs at session creation and cannot reliably identify subsequent DDL.

Using the PL/SQL Compiler

1 practice question on this topicWhat this topic covers

Question 13

Added

Dropdown

A release pipeline must enable PL/SQL compile-time warnings for one package compilation and make severe warnings prevent the build from succeeding. It must not change the instance-wide setting because unrelated teams compile concurrently. Complete the command by selecting the correct values for each blank.

Choose the correct value for each blank.

ALTER SESSION SET PLSQL_WARNINGS = ''; ALTER PACKAGE billing_api COMPILE ;
Correct answer:

ALTER SESSION SET PLSQL_WARNINGS = 'ENABLE:ALL'; ALTER PACKAGE billing_api COMPILE PLSQL_WARNINGS='ERROR:SEVERE';

ALTER SESSION scopes compiler-warning configuration to the release session, avoiding an instance-wide change. ENABLE:ALL turns on compile-time warnings, while the package compilation's PLSQL_WARNINGS setting maps severe warnings to errors for that compilation. DISABLE:ALL suppresses diagnostics. REUSE SETTINGS alone does not establish the required severe-warning policy, and DEBUG is unrelated to warning severity. Setting only a session warning policy without the compile-level error mapping would not make severe warnings fail the build.

Managing PL/SQL Code

1 practice question on this topicWhat this topic covers

Question 14

Added

Single Answer

A regulated application has a public package used by many schemas and a private helper package that must be callable only by that public package. The helper package is currently granted EXECUTE to all application schemas, and the security team wants to remove those direct grants while still permitting the intended call path. The public interface must remain unchanged, and access must be enforced by Oracle rather than by a naming convention. What is the best change?

Correct answer: D

ACCESSIBLE BY on the helper package can whitelist the intended PL/SQL unit, allowing Oracle to restrict direct access while the public package calls it. Removing broad EXECUTE grants eliminates the unnecessary privilege path, and the public specification need not change. AUTHID CURRENT_USER controls privilege resolution, not which PL/SQL unit may invoke a package. Whitelisting callers on the public package does not restrict access to the helper. Deprecation is a compiler-facing status and does not enforce runtime access control.

Managing Dependencies

1 practice question on this topicWhat this topic covers

Question 15

Added

Drag And Drop

A release engineer is diagnosing stale PL/SQL objects after a table change. The team needs to distinguish an invalid dependent object from an object that is valid but might have incurred recompilation overhead, and to identify dependency metadata for follow-up analysis. Match each operational need to the appropriate Oracle mechanism.

Drag each item onto its matching target. On a phone: tap an item, then tap a target.

Find dependent objects recorded as invalid
Inspect recorded object-to-object dependencies
Attempt recompilation of an invalid package body
ALTER PACKAGE package_name COMPILE BODY
USER_OBJECTS status
USER_DEPENDENCIES
Correct answer:
  • Find dependent objects recorded as invalid → USER_OBJECTS status
  • Inspect recorded object-to-object dependencies → USER_DEPENDENCIES
  • Attempt recompilation of an invalid package body → ALTER PACKAGE package_name COMPILE BODY

USER_OBJECTS exposes object status, allowing invalid dependents to be located. USER_DEPENDENCIES records dependency relationships and supports impact analysis. ALTER PACKAGE with COMPILE BODY explicitly recompiles a package body. Dependency metadata alone does not show current validity, and object status does not enumerate dependency edges. Recompiling the package specification rather than the body would target the wrong program unit when only the body needs recompilation.

More Oracle Practice Questions

Get the Full Oracle 1Z0-149 Dumps as PDF and Practice Test

15 questions are free on this page and the full set has 65. It comes as a PDF and an online practice test, with 90 days of free updates.