Limited-Time Offer: Enjoy 50% Savings! - Ends In 0d 11h 59m 14s Coupon code: 50OFF

Exam Details

Exam Code
1Z0-149
Vendor
Oracle
Question Types
Single ChoiceMultiple Choice
Official Page
View Exam Page
1

Declaring PL/SQL Variables

This topic covers valid PL/SQL identifiers, variable declarations and initialization, bind variables, and datatype attributes such as %TYPE. Candidates must select declarations that fit the required datatype and use variables correctly in a PL/SQL environment.

Question 1 of 46 Single Choice

A finance team is adding a local variable to a PL/SQL block that calculates an order total before sending it to an existing billing process. The team uses lowercase names that begin with a letter and separate words with underscores. The developer must choose a name that is a valid PL/SQL identifier and follows that naming convention.

Which identifier can the developer use for the local PL/SQL variable?

Show Answer

Correct Answer

A

Option A is correct because v_order_total begins with a letter and uses valid identifier characters. Option B is not correct because an identifier cannot begin with a numeral. Option C is not correct because a hyphen is not allowed in an unquoted identifier. Option D is not correct because SELECT is a reserved word.

Question 2 of 46 Multiple Choice

A payroll team is adding local variables to an anonymous PL/SQL block that prepares salary adjustments. The employee salary column may change datatype during a later schema update, so one local variable should remain aligned with that column. A second variable counts adjustment attempts and must never contain a null value. The team wants both declarations to provide their initial values in the declaration section.

Choose two statements that meet the requirements.

Select 2 answers, then check them.

Show Answer

Correct Answer

A, D

Option A meets the requirement because employees.salary%TYPE anchors the variable datatype to that column. Option D also meets it because DEFAULT 0 supplies an initial value for a NOT NULL variable. Option B is incorrect because %TYPE does not inherit the column's constraints. Option C is incorrect because a NOT NULL variable must be initialized when declared. Option E is incorrect because zero can initialize a numeric variable directly.

2

Writing Executable Statements

This topic covers executable PL/SQL statements, including expressions, sequence references, and conversions between datatypes. Candidates must also be able to work with nested blocks, qualify names when needed, and format code so its structure is clear.

Question 3 of 46 Single Choice

A shipment-processing block already has a NUMBER value named p_units and a VARCHAR2 variable named v_receipt. The value is a whole number, and the application accepts the session’s default numeric display format. The assignment copies p_units to v_receipt without calling a conversion function. What happens when the assignment executes?

A shipment-processing block already has a NUMBER value named p_units and a VARCHAR2 variable named v_receipt. The value is a whole number, and the application accepts the session’s default numeric display format. The assignment copies p_units to v_receipt without calling a conversion function. What happens when the assignment executes?

Show Answer

Correct Answer

A

Option A is correct because PL/SQL implicitly converts the NUMBER value to VARCHAR2 for the assignment, using the session’s default numeric format. Option B is not correct because this assignment permits an implicit conversion. Option C is not correct because the destination is character data. Option D is not correct because the assigned value must be converted to the destination datatype.

Question 4 of 46 Multiple Choice

A warehouse application creates a batch identifier and normalizes an externally supplied code in an anonymous PL/SQL block. The session has not yet referenced the batch sequence, so its current value is not established. The code may contain leading or trailing spaces and may use lowercase letters. The block must obtain a new identifier and produce an uppercase code without surrounding spaces.

Choose two. Which assignments meet the requirements?

Select 2 answers, then check them.

Show Answer

Correct Answer

A, B

Options A and B are correct. NEXTVAL obtains a new sequence value in a PL/SQL expression, and UPPER(TRIM(raw_code)) removes surrounding spaces before converting the code to uppercase. Option C is not correct because CURRVAL cannot be used in this session until NEXTVAL has been referenced. Option D omits trimming, while Option E omits uppercase conversion.

Question 5 of 46 Single Choice

A support team maintains a PL/SQL batch that sends status text to an existing logging routine. A recent change added a queue name that contains an apostrophe, and the message also includes two hyphens as ordinary text. During code review, a developer is checking how Oracle parses this expression fragment before approving the change. The fragment is 'Queue ''A'' -- delayed' || ' for ' || l_user.

Which interpretation of the expression fragment is correct?

Show Answer

Correct Answer

A

Option A is correct because doubled single quotation marks represent one quotation mark within the character literal, and || concatenates the expression's parts. Option B is not correct because doubled quotation marks do not split the literal. Option C is not correct because -- inside a quoted literal is text. Option D is not correct because || is the concatenation operator.

3

Writing SQL in PL/SQL

This topic covers SQL statements executed inside PL/SQL blocks, including queries that return values into PL/SQL variables, DML, and transaction control. Candidates must choose valid SQL syntax and manage changes at the required transaction scope.

Question 6 of 46 Single Choice

A customer service block must retrieve an account's credit limit and status before recording an authorized adjustment. The account_id column is a primary key, and the caller verifies that the requested account exists before running the block. Two local scalar variables, l_credit and l_status, are already declared for the returned values.

Which statement correctly retrieves both required values into the predeclared PL/SQL variables?

Show Answer

Correct Answer

A

Option A is correct because its INTO clause places the two selected column values into the matching predeclared variables, and the unique account_id condition guarantees one row. Option B puts INTO after the FROM clause, which is not the required SELECT syntax. Option C adds an invalid RETURNING clause. Option D omits account_status, so it does not retrieve both required values.

Question 7 of 46 Multiple Choice

A nightly inventory process runs inside a PL/SQL block after a separate reconciliation step has already made uncommitted changes in the same session. The block inserts shipment lines and reduces stock quantities. If batch validation fails, the application must undo only those shipment changes and leave the reconciliation work pending for its caller.

Choose two transaction statements the block should use.

Select 2 answers, then check them.

Show Answer

Correct Answer

A, B

Options A and B are correct because the savepoint is placed before the batch, and rolling back to it reverses the batch while leaving earlier uncommitted work pending. Option C commits all pending work, while Option D rolls back the entire transaction. Option E creates the savepoint too late to protect the batch, and Option F names a savepoint that the scenario does not establish.

4

Writing Control Structures

This topic covers choosing and writing PL/SQL IF and CASE control structures, including CASE expressions. Candidates must also construct loops and use EXIT and CONTINUE to control loop execution.

Question 8 of 46 Single Choice

A PL/SQL block must process integer values from 1 through 12 in order. The processing action must run for every value except multiples of 4. The block must stop after processing 10, and values 11 and 12 must not be processed. The loop counter must not be modified directly.

Which loop-body arrangement meets the processing requirements?

Show Answer

Correct Answer

A

Option A is correct because CONTINUE skips processing multiples of 4, while EXIT ends the loop after processing 10. Option B is not correct because EXIT on a multiple of 4 stops the loop at 4. Option C is not correct because it skips 10 and exits at 4. Option D is not correct because it processes multiples of 4 before exiting.

Question 9 of 46 Multiple Choice

A billing block classifies an amount into one of three bands. Amounts above 1000 use the highest-band action, amounts above 500 and up to 1000 use the middle-band action, and all remaining amounts use the lowest-band action. Exactly one action group must run, and the conditions are based on ranges rather than equality to fixed values.

Choose two. Which control structures can directly select and execute one of three action groups using the stated ranges?

Select 2 answers, then check them.

Show Answer

Correct Answer

A, B

Options A and B are correct because IF with ELSIF and a searched CASE statement can test these conditions and execute one matching action group. Option C is not correct because a simple CASE compares its selector with values, not relational conditions. Option D can execute both of its first two actions for amounts above 1000. Option E is not correct because a CASE expression is not a standalone PL/SQL statement.

Question 10 of 46 Single Choice

A training system must assign a one-character result code from a numeric score. Scores of 80 or higher receive the top-band code, scores from 50 through 79 receive the middle-band code, and lower scores receive the low-band code. The code must be produced as one expression in an assignment, rather than by running separate assignment statements.

Which choice uses a CASE expression to assign the required code?

Show Answer

Correct Answer

A

Option A is correct because a searched CASE expression can return a code from ordered conditions, so the higher threshold is tested first. Option B is not correct because simple CASE uses equality comparisons with its selector. Option C is not correct because a CASE statement cannot serve as an expression in an assignment. Option D returns the middle-band code for scores of 80 or more because its broader condition comes first.

5

Working with Composite Data Types

Composite data types let PL/SQL represent related fields in records and multiple values in collections. Candidates must select suitable record and collection forms, use records based on table rows, and understand how to define and initialize collections, including collections of records.

Question 11 of 46 Single Choice

A finance application has a PL/SQL routine that stages one complete row from the AUDIT_EVENT table while a reviewer examines the event. The table gains columns during planned releases, and the routine should continue to represent the full row without requiring its record declaration to be rewritten for each added column. The routine needs one row-shaped value, not a set of rows.

Which declaration approach best meets the requirement?

Show Answer

Correct Answer

A

Option A is correct because %ROWTYPE supplies a record whose fields correspond to all columns of the audit table, including columns added later. Option B is an indexed collection rather than one row-shaped record. Option C omits columns and will not track later table changes. Option D is also a collection, so it does not provide the required single-row record.

Question 12 of 46 Multiple Choice

A support team is building an in-memory cache of employee records for one PL/SQL processing session. Each record must hold an employee number, department number, and review status. Employee numbers are positive integers, but the cache will contain only a subset of employees, so its keys can have gaps. The team wants a collection organized directly by those keys.

Choose two. Which design statements meet the cache requirements?

Select 2 answers, then check them.

Show Answer

Correct Answer

A, B

Options A and B are correct because an associative array can use PLS_INTEGER keys and record elements, and its variable is ready for indexed assignments without a constructor. Option C describes a nested table, not a keyed associative array. Option D confuses a record with a collection. Option E uses positional varray indexes rather than employee identifiers as arbitrary keys.

6

Using Explicit Cursors

This topic covers how to declare, open, fetch from, and close explicit cursors. Candidates must use cursor attributes, parameterized cursors, cursor loops, and row locking when processing query results.

Question 13 of 46 Single Choice

A billing team reviews pending orders in a table that other sessions can also update. A PL/SQL block must fetch the pending orders one at a time and change each fetched order to a review status. The team requires each update to target the exact fetched row, and it cannot allow another session to change that row between the fetch and update.

Which approach meets the requirement to update each fetched row while protecting it from changes by another session?

Show Answer

Correct Answer

A

Option A is correct because FOR UPDATE locks the selected rows, and WHERE CURRENT OF identifies the row currently fetched by the cursor. Option B lacks the required row locking. Option C commits before the current row is updated, releasing its lock and disrupting the cursor. Option D updates the full set repeatedly instead of updating only the current row.

Question 14 of 46 Single Choice

A sales reporting block must process invoices for one region selected by the calling application. The existing query returns invoices from every region, and the block should process only rows matching the supplied region. The developer wants the loop to manage cursor opening, fetching, and closing, rather than adding separate cursor control statements.

Which approach retrieves and processes the qualifying sales rows for the supplied region while avoiding manual cursor open, fetch, and close operations?

Show Answer

Correct Answer

A

Option A is correct because a cursor FOR loop can call a parameterized cursor with the supplied region and manages opening, fetching, and closing. Option B has no cursor parameter to restrict the rows. Option C does not supply the required argument when opening the cursor. Option D omits the argument required when the cursor is called.

Question 15 of 46 Multiple Choice

A nightly reconciliation block manually opens cursor c and fetches its result rows into local variables. The developer checks cursor attributes to report how many rows were processed and to end the loop after the final row. The result set contains at least one row, and the block performs one final fetch that does not return a row before closing the cursor.

A block opens an explicit cursor, fetches rows into variables, and performs one additional fetch after the last row. Choose two statements that correctly describe the cursor attributes.

Select 2 answers, then check them.

Show Answer

Correct Answer

A, D

Options A and D are correct because opening sets %ISOPEN to TRUE with no fetched rows counted, and a failed fetch sets %NOTFOUND to TRUE without increasing %ROWCOUNT. Option B is incorrect because failed fetches do not increase the row count. Option C is incorrect because %NOTFOUND becomes TRUE only after a fetch fails. Option E is incorrect because the cursor is no longer open after CLOSE.

7

Handling Exceptions

This topic covers how PL/SQL identifies internally defined, predefined, and user-defined exceptions. Candidates must be able to handle exceptions appropriately and determine when an exception propagates to an enclosing block or caller.

Question 16 of 46 Single Choice

A warehouse application uses an anonymous PL/SQL block to reserve stock for a shipment. The block must reject a reservation that exceeds the quantity currently available, and its local exception handler must record that specific business-rule violation while allowing unrelated database errors to remain distinguishable. The team does not want this condition represented as an Oracle error number.

Which implementation meets the requirement that this business-rule violation be represented by a named exception and handled locally?

Show Answer

Correct Answer

A

Option A is correct because declaring, raising, and locally handling the named exception rejects the excessive reservation as required. Option B is not correct because a declared exception is not raised automatically when the condition occurs. Option C is not correct because RAISE_APPLICATION_ERROR raises an application error, not the declared user-defined exception. Option D is not correct because WHEN OTHERS alone does not implement the required named exception.

Question 17 of 46 Multiple Choice

An order-entry batch inserts rows into ORDERS. The primary key can conflict with an existing order, and a row can also reference a CUSTOMER_ID that does not exist. The application must record these two failures under different business messages, continue to let unrelated database errors propagate to its caller, and avoid treating a missing parent row as a missing SELECT result.

Choose two. Which exception handling approaches meet the application's requirements?

Select 2 answers, then check them.

Show Answer

Correct Answer

A, B

Options A and B are correct because DUP_VAL_ON_INDEX handles the duplicate key, and EXCEPTION_INIT maps the exception to ORA-02291. Option C is not correct because it consumes unrelated errors and gives both failures one message. Option D is not correct because ORA-02291 is not NO_DATA_FOUND. Option E is not correct because an unassociated user exception does not catch ORA-02291. Option F is not correct because -1 identifies a different error.

8

Using PL/SQL Subprograms

This topic covers the difference between anonymous PL/SQL blocks and named subprograms. Candidates must recognize how a procedure can be invoked from a block and why subprograms support reuse and central maintenance.

Question 18 of 46 Single Choice

A finance team runs the same reconciliation steps during nightly processing and during occasional manual checks. The database administrator wants the logic stored once as a named database object, so it can be maintained centrally. A scheduled script should be able to call it, and a developer should also be able to run it from a short PL/SQL test block.

Which implementation best meets the team's requirements?

Show Answer

Correct Answer

A

Option A is correct because a named standalone procedure can be stored in the schema and invoked from an anonymous block, allowing the nightly task to call the same routine. Option B is not correct because an anonymous block is not stored as a named schema subprogram. Option C is not correct because a procedure is not called as a function in a SELECT statement. Option D duplicates the routine.

Question 19 of 46 Multiple Choice

A support team and a scheduled job both need to write the same audit record after a maintenance operation. The team currently maintains two nearly identical anonymous blocks, and updates to one are sometimes missed in the other. They want one reusable implementation in the database, but they do not expect the routine to return a value to SQL or bypass database security.

Choose two. Which statements describe benefits of the proposed design?

Select 2 answers, then check them.

Show Answer

Correct Answer

A, C

Options A and C are correct because the same named procedure can serve both callers, and its stored code can be maintained centrally. Option B is not correct because repeated submission does not turn an anonymous block into a named schema object. Option D is not correct because procedures are not SQL expressions. Options E and F are not correct because storage does not guarantee success or remove privilege requirements.

9

Creating Procedures and Using Parameters

This topic covers creating standalone procedures and passing values through their parameters. Candidates must be able to choose appropriate parameter modes, invoke procedures with positional or named notation, and replace a procedure definition when required.

Question 20 of 46 Single Choice

A warehouse application needs a standalone procedure that accepts a required order number, uses MAIN as the default warehouse when none is supplied, and returns a generated tracking number. Several client blocks call the procedure, and some omit the warehouse value by using named notation. The order number is supplied as input and is not changed by the procedure.

A warehouse application needs a standalone procedure that accepts a required order number, uses MAIN as the default warehouse when none is supplied, and returns a generated tracking number. Client blocks will use named notation when omitting the warehouse. Which parameter declaration meets these requirements?

Show Answer

Correct Answer

A

Option A is correct because the order number is an input, the warehouse input has a default, and the tracking number is returned through an OUT parameter. Option B cannot return the tracking number because it declares that parameter as IN. Option C gives a default to an OUT parameter. Option D requires the order number parameter to support output as well as input.

Question 21 of 46 Multiple Choice

A support team is reviewing a standalone procedure named CALCULATE_FEE in its own schema after a deployment. The procedure is present, but the team needs to confirm its stored program metadata and verify the positions, modes, datatypes, and default indicators of its formal parameters. The team wants to use data dictionary views rather than retrieve and inspect the source text.

Choose two. Which data dictionary views should the support team query?

Select 2 answers, then check them.

Show Answer

Correct Answer

A, B

Options A and B are correct because the team needs to confirm the standalone procedure's metadata and inspect the declared details of its parameters. Option C provides source text, not the requested object and argument metadata. Option D describes table columns, and Option E reports compilation errors rather than parameter declarations.

Question 22 of 46 Single Choice

A billing team has a standalone procedure named refresh_invoice_status that is called by several application modules. A tested revision changes the procedure body, but its name and parameter list remain unchanged. The deployment must install the new body through a SQL script and should not remove the existing procedure before applying the revision.

Which action installs the revised body while retaining the existing standalone procedure name?

Show Answer

Correct Answer

A

Option A is correct because CREATE OR REPLACE PROCEDURE installs the revised definition under the existing standalone procedure name. Option B attempts to create an object that already exists. Option C does not replace a procedure body, since ALTER PROCEDURE is used for operations such as compilation. Option D unnecessarily drops the object before recreating it.

10

Creating Functions

This topic covers creating, invoking, and removing stored functions, along with the distinction between a function and a procedure. Candidates must be able to define a function that returns a value and use that value in an appropriate SQL or PL/SQL expression.

Question 23 of 46 Single Choice

A payroll team is adding a stored calculation for a monthly report. The calculation accepts an employee's eligible pay and returns one numeric allowance amount. The report must call the calculation as part of a SQL expression, and the team wants the result supplied as the function's return value rather than as a separate output argument. Which definition best meets the reporting requirement?

Which definition best meets the reporting requirement?

Show Answer

Correct Answer

A

Option A is correct because the report needs a function that returns a NUMBER value, and its body must return the calculated result. Option B is not correct because a procedure does not declare a function return datatype. Option C is not correct because a function requires a return datatype. Option D is not correct because the function must execute a RETURN statement to provide its result.

Question 24 of 46 Multiple Choice

A finance application has a stored function named TIER_CREDIT that accepts one NUMBER argument and returns a NUMBER. Its required argument is a customer's annual sales amount. A reporting query needs to display the credit, while a nightly PL/SQL routine needs to store the same returned value in V_CREDIT. Which two forms correctly use the value returned by TIER_CREDIT?

Choose two. Which two forms correctly use the value returned by TIER_CREDIT?

Select 2 answers, then check them.

Show Answer

Correct Answer

A, B

Options A and B are correct because the query uses the function call as an expression, while the PL/SQL assignment stores its returned value. Options C and D are not correct because each omits the required input argument. Option E is not correct because a function call used in PL/SQL must contribute its returned value to an expression, such as an assignment.

Question 25 of 46 Single Choice

A warehouse application has stopped using the standalone function ORDER_SCORE after its scoring rules were retired. The function is no longer needed, and the maintenance window permits removal of this one database object. The administrator has confirmed that the object is a function, not a procedure, and must select the DDL statement that removes it rather than changing its definition. Which statement should the administrator use to remove the obsolete standalone function?

Which statement should the administrator use to remove the obsolete standalone function?

Show Answer

Correct Answer

A

Option A is correct because DROP FUNCTION removes a standalone stored function, and ORDER_SCORE is the object identified for removal. Option B is not correct because DELETE is not the DDL statement for removing a stored program unit. Option C is not correct because ORDER_SCORE is a function, not a procedure. Option D is not correct because it creates or replaces a function instead of removing it.

11

Creating Packages

This topic covers package specifications, package bodies, and the roles of public and private subprograms. Candidates must be able to design package interfaces, create implementations, and use overloading and forward declarations correctly.

Question 26 of 46 Single Choice

An accounts-payable system is being decommissioned after its replacement has passed acceptance testing. In the owning schema, package BILLING_API has a specification used by client compilation and a body containing its implementations. Change control requires the package name to become unavailable to new compilations, and both stored package objects must be removed with one DDL statement.

Which statement should the engineer run to remove both the package specification and its body?

Show Answer

Correct Answer

B

Option B is correct because DROP PACKAGE removes both BILLING_API objects, making the package unavailable to new compilations. Option A is not correct because it removes only the body and leaves the specification. Option C is not correct because a package is not a standalone procedure. Option D is not correct because it recompiles the package instead of removing it.

Question 27 of 46 Multiple Choice

A retailer maintains a STOCK_API package in the INVENTORY schema. Several application jobs must call its RECONCILE_STOCK procedure, and the security team will grant those accounts EXECUTE access to the package. The procedure implementation changes often, but its public interface must remain stable so clients do not need changes whenever the reconciliation logic is revised.

Choose two actions that meet the requirements.

Select 2 answers, then check them.

Show Answer

Correct Answer

B, C

Options B and C are correct. The specification exposes the procedure signature, while the body supplies its implementation, and the granted client can call it with schema and package qualification. Option A is not correct because a body-only procedure is private. Option D is not correct because a package specification contains declarations, not a full procedure implementation. Option E is not correct because a standalone procedure is not part of the package.

12

Working with Packages

This topic covers the use of public package types, variables, constants, and functions. Candidates must be able to use these declarations in PL/SQL and SQL, and identify which units may access a restricted package subprogram.

Question 28 of 46 Single Choice

A customer support system uses the package customer_state_pkg. Its specification declares the public subtype CustomerKey_t and the public variable g_selected_customer. A support block must hold a customer key using the package-defined subtype and store the selected key in the package variable so another call in the same session can read it. Which approach meets the requirement?

Which approach meets the requirement?

Show Answer

Correct Answer

A

Option A is correct because the package specification exposes both names, allowing the block to declare the key with the qualified subtype and update package state. Option B is not correct because public declarations are usable outside the body. Option C is not correct because the subtype name is not visible unqualified. Option D is not correct because it changes only a local variable.

Question 29 of 46 Multiple Choice

A billing block queries open orders using order_rules_pkg. The package specification exposes c_active as a VARCHAR2 constant and declares a function that accepts one NUMBER and returns a NUMBER. A separate helper function and a constant are declared only in the package body. The block issues a SELECT statement from PL/SQL and must use supported package references in its SQL expression.

Choose two. Which two references can the block use in its SQL statement?

Select 2 answers, then check them.

Show Answer

Correct Answer

A, B

Options A and B are correct because the SQL runs from PL/SQL, and the public VARCHAR2 constant and public NUMBER-returning function are eligible references in that statement. Option C is not correct because a body-only function is not visible to the caller. Option D is not correct because SQL-invoked functions cannot have OUT parameters. Option E is not correct because a SQL expression cannot use a BOOLEAN result in Oracle Database 19c. Option F is not correct because a body-only constant is not public.

Question 30 of 46 Single Choice

A finance application has an internal package ledger_internal whose specification restricts access to the package subprogram under review with an ACCESSIBLE BY clause naming only PACKAGE settlement_engine. The finance team wants ordinary application packages and ad hoc blocks to remain unable to call it directly. A developer is checking which caller satisfies the existing restriction.

Which caller is permitted to access the package subprogram under the stated restriction?

Show Answer

Correct Answer

A

Option A is correct because the whitelist names settlement_engine as an authorized package, and the call originates directly from that package. Option B is not correct because invoice_portal is not listed. Option C is not correct because an anonymous block is not the named package. Option D is not correct because batch_loader is absent from the whitelist.

13

Using Dynamic SQL

This topic covers building SQL or PL/SQL text at runtime and executing it with Native Dynamic SQL. Candidates must choose the right execution form, bind data values, and use supported PL/SQL types in dynamic calls.

Question 31 of 46 Single Choice

A billing team maintains a reporting package that reads from one of two regional invoice tables. The table name is selected at runtime from a fixed, approved mapping, and both tables have the same columns. The package must return one amount for a supplied invoice identifier. Its requirements prohibit concatenating data values into SQL text.

Which implementation meets the requirements?

Show Answer

Correct Answer

A

Option A is correct because the selected table name is part of SQL text, while the invoice identifier remains a bind value and the single result goes into l_amount. Option B is not correct because a bind placeholder cannot stand for a table identifier. Option C is not correct because it embeds the data value in SQL text despite the stated requirement. Option D is not correct because EXECUTE IMMEDIATE places INTO before USING.

Question 32 of 46 Multiple Choice

An order-processing team calls a package procedure through a generated PL/SQL block. The procedure accepts an IN BOOLEAN flag, an IN associative array of order codes, and an OUT NUMBER count. The array type is declared in the package specification and uses PLS_INTEGER indexes. The team must pass local PL/SQL values without converting them to SQL scalar types.

Choose two. Which statements correctly describe how the team can pass these values through Native Dynamic SQL?

Select 2 answers, then check them.

Show Answer

Correct Answer

A, E

Options A and E are correct because the anonymous block can bind BOOLEAN, and Native Dynamic SQL associative arrays require a package-declared type indexed by PLS_INTEGER. Option B is not correct because BOOLEAN is supported for an anonymous PL/SQL block. Option C is not correct because the type must be package-declared. Option D is not correct because an OUT parameter belongs in USING, not a query INTO clause.

14

Design Considerations for PL/SQL Code

This topic covers design choices that affect the safety, performance, and run-time behavior of PL/SQL code. Candidates must select appropriate transaction, privilege, and bulk-processing features to meet stated requirements.

Question 33 of 46 Single Choice

A payroll application calls a stored audit routine after recording a sensitive salary change. The application must be able to roll back the salary change if a later validation fails, but the audit row must remain committed. The audit routine only inserts its audit row and must not commit or roll back any work performed by the caller.

Which design best ensures that the audit record remains committed if the caller later rolls back its transaction?

Show Answer

Correct Answer

A

Option A is correct because an autonomous routine has a transaction independent of the caller, and its explicit commit preserves the audit row when the caller rolls back. Option B commits unrelated caller work. Option C leaves the autonomous transaction unresolved when the routine exits. Option D changes privilege behavior but keeps the insert in the caller's transaction.

Question 34 of 46 Multiple Choice

A compensation service receives a dense PL/SQL collection of unique employee IDs and must apply the same percentage increase to each employee. Each ID matches exactly one row. The service must reduce SQL-to-PL/SQL context switches and return every resulting salary to the caller, while keeping transaction control with the calling application.

Choose two implementation choices that meet the requirements.

Select 2 answers, then check them.

Show Answer

Correct Answer

A, C

Options A and C are correct because FORALL bulk-binds the updates and RETURNING BULK COLLECT INTO gathers the resulting salaries for the affected rows. Option B retains row-by-row execution. Option D does not collect the results from the FORALL operation. Option E does not return the changed values, and Option F adds commits that the stated requirements do not request.

Question 35 of 46 Single Choice

A database team provides a shared stored routine for several application users. Security policy requires SQL statements issued by the routine to be checked using the privileges of the user making each call, rather than the privileges of the schema that owns the routine. The team wants to preserve the existing grants and needs to choose the appropriate rights mode.

Which declaration setting meets the requirement that SQL in the routine use the privileges of the user who invokes it?

Show Answer

Correct Answer

A

Option A is correct because AUTHID CURRENT_USER makes the routine execute with the invoker's privileges at run time, matching the security requirement. Option B uses the owner's privileges instead. Option C grants permission to call the routine but does not change its rights mode. Option D concerns a function's behavior, not privilege checking.

15

Creating Compound, DDL, and Event Database Triggers

This topic covers compound triggers, DDL triggers, and triggers that respond to database events. Candidates must select an appropriate trigger type and timing, and use trigger event attributes to carry out required actions.

Question 36 of 46 Single Choice

A payroll application updates several rows in the EMPLOYEES table with one statement. A summary table stores the employee count for each department. A conventional row-level trigger currently queries EMPLOYEES to recalculate the affected department count, but the update fails with a mutating-table error. The summary must reflect all changes made by each statement.

Which design best prevents the mutating-table error while keeping the department summary accurate after each update statement?

Show Answer

Correct Answer

A

Option A is correct because the row section can record affected departments, and the statement section can query the employee table after the update finishes. Option B is not correct because querying the table from a row-level trigger can cause a mutating-table error. Option C calculates from pre-update data. Option D does not recalculate the department total from all its employees.

Question 37 of 46 Multiple Choice

A development team must audit CREATE, ALTER, and DROP statements performed in its application schema. The database also contains unrelated schemas whose DDL activity must not be written to this audit table. Each audit row must include the event type and affected object name, and the team wants to implement the audit with a database trigger.

Choose two actions that meet the audit requirements.

Select 2 answers, then check them.

Show Answer

Correct Answer

A, B

Options A and B are correct because a schema-level DDL trigger covers DDL in that schema, and the named event attributes provide the event and object name. Option C is not correct because ON DATABASE applies database-wide rather than limiting the trigger to one schema. Option D is not valid for a DDL trigger. Option E is not correct because DDL triggers do not use the row-level :NEW pseudorecord.

Question 38 of 46 Single Choice

A company uses a connection pool that connects to one Oracle Database 19c instance with several application schemas. The security team needs a row in a central audit table for every successful user logon, including logons by administrators and application accounts. The team wants one database trigger rather than changes to each application.

Which trigger design meets the requirement to record successful logons from every database user?

Show Answer

Correct Answer

A

Option A is correct because an AFTER LOGON ON DATABASE trigger handles successful logons across the database, and ORA_LOGIN_USER identifies the login user. Option B is not correct because a schema-level trigger does not capture logons for every database user. Option C handles DDL events, not logons. Option D fires when a session ends, so it cannot record the session as it begins.

16

Using the PL/SQL Compiler

This topic covers how the PL/SQL compiler translates and optimizes program units, along with settings that control compilation and compile-time warnings. Candidates must choose suitable compiler parameters and configure warnings to support specific development and deployment requirements.

Question 39 of 46 Single Choice

A data-processing team has a PL/SQL routine that performs substantial computation, and testing shows that interpreted execution is too slow. The database administrator is permitted to change session settings for the compilation session, but must leave instance-wide settings unchanged. The team has already confirmed that the routine is suitable for native compilation. The administrator must choose the relevant compiler setting.

Which initialization parameter should the administrator set for the compilation session?

Show Answer

Correct Answer

A

Option A is correct because PLSQL_CODE_TYPE set to NATIVE selects native compilation for the unit compiled in this session. Option B sets the optimization level but does not select native compilation. Option C controls compiler warnings. Option D sets conditional compilation flags, which do not select the generated code type.

Question 40 of 46 Multiple Choice

A release pipeline compiles a standalone PL/SQL routine during deployment. The review team must see warnings from every compiler warning category, but the build must fail if the compiler reports PLW-06002 for unreachable code. Other warnings should remain warnings, and the change must apply to the deployment compilation session rather than altering the database-wide configuration.

Choose two actions that meet the pipeline requirements.

Select 2 answers, then check them.

Show Answer

Correct Answer

A, B

Options A and B are correct because enabling all warning categories keeps other warnings visible, while treating PLW-06002 as an error rejects the specified warning. Option C suppresses the warnings the pipeline needs to review. Option D controls optimization, not warning handling. Option E selects native compilation and does not make warnings errors.

Question 41 of 46 Single Choice

A developer is investigating a difficult stepping issue in a routine compiled for a test environment. The team wants to compile that routine with the lowest PL/SQL optimization level so that optimizer transformations do not complicate the investigation. The developer can adjust the current session before compilation, but cannot change database-wide settings or modify conditional compilation directives in the source.

Which session setting should the developer use for the compilation?

Show Answer

Correct Answer

A

Option A is correct because PLSQL_OPTIMIZE_LEVEL set to 0 disables compiler optimization for the unit compiled in that session. Option B changes the compilation code type, not its optimization level. Option C disables warnings rather than controlling optimization. Option D affects conditional compilation flags and does not disable optimizer transformations.

17

Managing PL/SQL Code

This topic covers compile-time selection of PL/SQL code, roles granted to program units, and ways to control how other code uses or identifies a program unit. Candidates must choose suitable compiler directives and grants, and apply deprecation information without disrupting required callers.

Question 42 of 46 Single Choice

A finance application has one PL/SQL procedure used in both development and production. Developers need a call to an internal trace package while diagnosing a nightly reconciliation problem, but that package is not installed in production. The team wants to keep one maintained source version and ensure the production unit contains no reference to the trace package.

Which approach will keep the trace call out of the production version at compile time?

Show Answer

Correct Answer

B

Option B is correct because the compile-time flag lets the compiler exclude the trace code when it compiles the production unit. Option A still leaves the code subject to compilation and only changes run-time behavior. Option C controls optimization, not conditional compilation. Option D depends on editing source rather than selecting code through a compiler flag.

Question 43 of 46 Multiple Choice

A reporting schema owns a definer-rights procedure named APP.refresh_summary. It reads one source table, but the security team will not grant that table privilege directly to the schema owner because the owner has other stored code. The team wants only this procedure to receive the required access, and it wants the role to contain no unrelated privileges.

Choose two actions that provide the procedure with the required table access through code-based access control.

Select 2 answers, then check them.

Show Answer

Correct Answer

A, B

Options A and B are correct because the role holds the limited table privilege and is granted to the specific program unit that needs it. Option C is not correct because roles granted to a user are disabled in definer-rights program units. Option D is not correct because object privileges are not granted directly to a procedure. Option E changes privilege behavior without being needed for this unit-specific grant.

Question 44 of 46 Single Choice

A package specification exposes the procedure LEGACY_SYNC, which is still called by several older applications. A new procedure, SYNC_CURRENT, replaces it, but those applications cannot be upgraded in the current release. The team wants PL/SQL compilation to identify new references to LEGACY_SYNC and direct developers to SYNC_CURRENT without removing the old procedure.

Which change marks the old public procedure as deprecated while leaving it available to existing callers?

Show Answer

Correct Answer

B

Option B is correct because a DEPRECATE pragma in the specification marks the public procedure and can provide a replacement message while preserving the entry point. Option A removes it from the public interface. Option C provides no compiler-recognized deprecation notice. Option D suppresses warnings rather than identifying this procedure as deprecated.

18

Managing Dependencies

This topic covers how Oracle tracks dependencies between stored PL/SQL units and the database objects they reference. Candidates must be able to identify dependent objects and understand when a change can invalidate a stored unit.

Question 45 of 46 Single Choice

A payroll schema has a CALC_BONUS procedure that reads the BONUS_RATE column from the EMPLOYEE table. The procedure has compiled successfully and is currently valid. A release adds a new AUDIT_TAG column to EMPLOYEE, but no source code changes are made and CALC_BONUS does not refer to AUDIT_TAG. The DBA wants to know whether the procedure needs recompilation.

After the DDL completes, what should the DBA expect for CALC_BONUS?

Show Answer

Correct Answer

A

Option A is correct because adding a column that CALC_BONUS does not reference does not change the elements on which it depends. Option B is not correct because Oracle tracks dependencies at a finer level than the whole table. Option C is not correct because the procedure need not use every table column. Option D is not correct because dependencies are tracked automatically.

Question 46 of 46 Multiple Choice

In a payroll schema, CALC_NET reads the SALARY column from EMPLOYEE, and POST_PAYROLL calls CALC_NET. A release drops SALARY and adds a differently named SALARY_NEW column. Both stored program units now show INVALID. Before editing either unit, the DBA must identify which units directly depend on EMPLOYEE and verify the status of stored program objects.

Which two statements correctly describe how the DBA can identify direct dependents of EMPLOYEE and check the status of stored program units? Choose two.

Select 2 answers, then check them.

Show Answer

Correct Answer

A, B

Options A and B are correct. USER_DEPENDENCIES identifies dependent objects through REFERENCED_NAME and REFERENCED_TYPE, while USER_OBJECTS reports object status. Option C reverses the roles of NAME and REFERENCED_NAME. Option D is not correct because USER_DEPENDENCIES does not report the referenced column. Options E and F are not correct because object status does not provide a dependency chain, and EMPLOYEE is not invalidated by having dependents.

Continue Your 1Z0-149 Preparation

You have seen 46 questions from a full set of 65. Prepare with the 1Z0-149 dumps PDF and the Web-Based Practice Test.

PDF

  • Compatible with All Devices
  • Printable Format
  • No Download Limits

Practice Test

  • Check your timing and weak areas
  • No Practice Limits
  • Regularly Updated
Get Full Access
  • 100% Money-Back Guarantee
  • 90 Days Free Updates
  • Instant Access

Frequently Asked Questions

Which PL/SQL topics tend to make 1Z0-149 challenging?

The difficulty often lies in tracing how several PL/SQL features interact, rather than recalling one definition. A block may combine a cursor, exception handling, and transaction control, so a small change can affect which rows are processed or whether changes are committed. Packages, dynamic SQL, and trigger timing also require careful attention to scope and execution context. Practise tracing code line by line, and record what each block changes or returns.

Why can cursor and exception questions be difficult to reason through?

Explicit cursors involve a sequence of actions, cursor attributes, and sometimes parameter values or row locking. Exception questions add another layer because an exception may be handled locally or propagate to an enclosing block or caller. In combination, these details can make the final behavior less obvious than the syntax alone. For each practice example, note when the cursor opens, fetches, and closes, then trace the exception path separately.

How should I manage the breadth of this exam's PL/SQL topics?

The topic list ranges from variable declarations and control structures to compiler settings, dependencies, triggers, and program-unit privileges. Spending all study time on familiar block syntax can leave less common areas unreviewed. Organize your preparation by task, such as writing stored programs, managing package interfaces, or controlling compilation and dependencies. The Exam4Success PDF guide can support review away from a lab. Use it to mark topics that need hands-on practice.

Why does knowing PL/SQL syntax sometimes fail to prepare candidates for code scenarios?

Syntax knowledge does not always reveal whether a declaration is valid in context, whether a function can be used in a particular expression, or which package subprogram is accessible. Scenario work requires you to connect the requirement to scope, privileges, data types, and run-time behavior. When an answer is wrong, identify the rule behind the error rather than memorizing the code. The Exam4Success Practice Test can help expose recurring weak areas for focused review.

What practical skills does 1Z0-149 focus on developing?

The exam topics center on writing and maintaining PL/SQL in Oracle Database 19c. They include building procedures, functions, and packages, handling database changes with triggers, and working with cursors, collections, and dynamic SQL. The design topics also address transaction choices, privileges, bulk processing, and dependencies. These are useful capabilities for developers who work with database-side application logic. Choose a small requirement and practise implementing it as a named PL/SQL unit.

How can the package and subprogram topics help in database development work?

Procedures and functions let developers reuse logic, while packages provide an interface that separates public declarations from private implementation details. Understanding parameters, overloading, and package access helps you organize code that other units can call and maintain. This exam also covers dependencies and deprecation, which matter when existing callers rely on a program unit. Practise designing a package specification first, then decide which implementation details belong only in its body.

What should I study first if I am beginning preparation for 1Z0-149?

Start with the foundations that appear across many topics, including declarations, data types, executable statements, SQL in PL/SQL, and control structures. Then move to records and collections, cursors, and exception propagation before studying stored procedures, functions, and packages. Finish with dynamic SQL, triggers, compiler controls, and dependencies. This order builds from block behavior toward program-unit management. After each section, write or trace a short example to check that you can apply the rules.

How can I judge whether I am ready to review this exam's full range of topics?

Readiness is easier to assess by task than by hours studied. Check whether you can select valid declarations, trace cursor and exception behavior, distinguish procedure and function use, and reason about package visibility and dependencies without relying on memorized examples. Include dynamic SQL, trigger timing, and compiler settings in that review. Take an Exam4Success Practice Test to identify topics that still need work, then revisit those areas in the guide and practise them again.

Exam4Success is an independent exam preparation provider and is not affiliated with or endorsed by Oracle.