Labour Day Special - Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: top65certs

Oracle 1z0-144 Dumps

Page: 1 / 4
Total 103 questions

Oracle Database 11g: Program with PL/SQL Questions and Answers

Question 1

Which two statements are correct about PL/SQL package components? (Choose two)

Options:

A.

A package must have both specification and body.

B.

A package body can exist without the package specification.

C.

A package specification can exist without the package body.

D.

When a packaged public variable is called for the first time in a session, the entire package is loaded into memory.

Question 2

Examine the following PL/SQL code:

Which statement is true about the execution of the code if the query in the PL/SQL block returns no rows?

Options:

A.

The program abruptly terminates and an exception is raised.

B.

The program executes successfully and the output is No ROWS_FOUND.

C.

The program executes successfully and the query fetches a null value in the V_LNAME variable.

D.

Program executes successfully, fetches a NULL value in the V_LNAME variable and an exception is raised.

Question 3

Which two guidelines are recommended by Oracle to reduce invalidation of dependent objects? (Choose two.)

Options:

A.

Reference tables indirectly by using views.

B.

Reference tables directly avoid using views.

C.

When adding new items to a package, add them to the end of the package.

D.

When adding new items to a package, add them to the beginning of the package.

Question 4

You create the following table and execute the following code:

Which statement is true about the outcome of the above code?

Options:

A.

It executes successfully and all the rows are updated.

B.

It gives an error but saves the inserted rows and the update to the first row.

C.

It gives an error but saves the inserted rows; however, no rows are updated.

D.

It gives an error and all the data manipulation language (DML) statements are rolled back

Question 5

View the exhibit and examine the structure of the products table.

Examine the following code

Which statement is true when the procedure DELETE_DETAILS is invoked?

Options:

A.

It executes successfully but no error messages get recorded in the DEBUG_OUTPUT table

B.

It executes successfully and any error messages get recorded in the DEBUG_OUTPUT table.

C.

It gives an error because PRAGMA AUTONOMOUS_TRANSACTION can be used only in packaged procedures.

D.

It gives an error because procedures containing PRAGMA AUTONOMOUS_TRANSACTION cannot be called from the exception section.

Question 6

Which statements correctly describe the features of functions and procedures? (Choose all that apply.)

Options:

A.

A procedure can contain a return statement without a value.

B.

A function can return multiple values using a single return clause.

C.

A procedure can be executed as part of a SQL expression or as a PL/SQL statement,

D.

A function can contain zero or more parameters that are transferred from the calling environment.

Question 7

Which two statements are true about the exit statement encountered in loop? (Choose two)

Options:

A.

The PL/SQL block execution terminates immediately after the exit statement.

B.

The loop completes immediately and control passes to the statement after end loop

C.

The statements after the exit statement in the Iteration are not executed before terminating the LOOP.

D.

The current iteration of the loop completes immediately and control passes to the next iteration of the loop.

Question 8

You execute the following block of code:

Which statement is true about the outcome?

Options:

A.

Both Output statements show different values.

B.

Both output statements show exactly the same values.

C.

It gives an error because the nested blocks are not labeled.

D.

It gives an error because the V_CUSTOMER variable have different types in the nested blocks

Question 9

Which three statements are true about wrapping? (Choose three.)

Options:

A.

The PL/SQL wrapper detects and reports only syntax errors.

B.

The PL/SQL wrapper detects and reports both syntax and semantic errors.

C.

When wrapping a package or object type, both the body and specification should be wrapped.

D.

When wrapping a package or object type, only the body should be wrapped, not the specification.

E.

To change a wrapped object, the original source code needs to be modified and then wrapped again

F.

To change a wrapped object, the wrapped code can be unwrapped, modified In a text file, and then wrapped again.

Question 10

Examine the following DECLARE section of PL/SQL block:

Which line in the above declaration would generate an error?

Options:

A.

Line 2

B.

Line 3

C.

Line 4

D.

Line 5

E.

Line 6

Question 11

What is the correct definition of the persistent state of a packaged variable?

Options:

A.

It is a private variable defined in a procedure or function within a package body whose value is consistent within a user session.

B.

It is a public variable in a package specification whose value is consistent within a user session.

C.

It is a private variable in a package body whose value is consistent across all current active sessions.

D.

It is a public variable in a package specification whose value is always consistent across all current active sessions.

Question 12

View Exhibit1 and examine the structure of the employees table.

User SCOTT needs to generate a text report that contains the names of all employees and their salaries.

Examine the following commands issued by the DBA:

SQL_CREATE DICTORY my_dir AS '/temp/my_files* ;

SQL_GRANT WRITE ON DIRECTORY my_dir TO SCOTT;

View Exhibit2 and examine the procedure code. You issue the following command:

You issue the following command:

SQL_EXEC sal_5tatus ('MY_DIR', ‘EMPREPORT.TXT')

What is the outcome?

Options:

A.

It executes successfully and creates the report.

B.

It gives an error because the text file should be opened in append mode.

C.

It gives an error because the "no data found" condition is not handled to come out of the loop.

D.

It gives an error because user SCOTT should be granted both read and write privileges to the directory alias.

E.

It executes but no data is written to the text file because the FFLUSH subprogram is not used to write all the data buffered in memory to a file.

Question 13

Identify the scenario in which you would use the current of clause for an update or delete statement to rows fetched from a cursor.

Options:

A.

when you want to lock the rows fetched by the cursor

B.

when you want to update or delete the result set without affecting the rows in the table

C.

when you want the database not to wait if the requested rows are locked by another user

D.

when you want to ensure that the current rows fetched by the cursor are updated or deleted

Question 14

In which of the following scenarios would you recommend using PL/SQL records?

Options:

A.

when you want to retrieve an entire row from a table and perform calculations

B.

when you know the number of elements in advance and the elements are usually accessed sequentially

C.

when you want to create a separate lookup table with multiple entries for each row of the main table, and access it through join queries

D.

when you want to create a relatively small lookup table, where the collection can be constructed in memory each time a subprogram is invoked

Question 15

View the Exhibit to examine the PL/SQL code.

SERVEROUTPUT is on for the session.

Which statement is true about the execution of the code?

Options:

A.

The execution fails because of the misplaced else clause.

B.

The execution is successful even if there is no employee with EMPLOYEE_ID 115.

C.

The execution falls and throws exceptions if no employee with EMPLOYEE_ID us is found.

D.

The execution is successful, but it displays an incorrect output if no employee with EMPLOYEE_ID 115 is found.

Page: 1 / 4
Total 103 questions