Oracle Database 11g: Program with PL/SQL v8.5 (1z0-144)

Page:    1 / 7   
Total 103 questions

Examine the following partial declare section from a block of PL/SQL code


Which line(s) in the above code are NOT valid? (Choose all that apply.)

  • A. line 2
  • B. line 3
  • C. line 4
  • D. line 5


Answer : B,D

View the Exhibits and examine the structure of the EMPLOYEES, DEPARTMENTS AND
EMP_BY_DEPT tables.

EMPLOYEES -



DEPAERTMENT -


EMP_BY_DEPT -

Examine the following code:

What is the outcome on execution of the above code?

  • A. It executes successfully but the output statements show different values.
  • B. It executes successfully and both output statements show the same values.
  • C. It gives an error because the SQL%ROWCOUNT attribute cannot be used with BULK COLLECT.
  • D. It gives an error because the INSERT SELECT construct cannot be used with the FORALL


Answer : A

User SCOTT has been granted CREATE ANY TRIGGER AND ALTER ANY TABLE by the

  • A. Only HR
  • B. SCOTT and HR
  • C. Only SCOTT
  • D. SCOTT, HR, and SYS


Answer : A

Which two statements are true about the usage of the cursor for loops? (Choose two.)

  • A. The cursor needs to be closed after the iteration is complete.
  • B. The implicit open, fetch, exit, and close of the cursor happen.
  • C. The record type must be explicitly declared to control the loop.
  • D. The PL/SQL creates a record variable with the fields corresponding to the columns of the cursor result set.


Answer : B,D

View the exhibit to examine the PL/SQL code.


Which statement is true about the exception handlers in the PL/SQL code?

  • A. All the exceptions in the code are trapped by the exception handler.
  • B. All the "no data found" errors in the code are trapped by the exception handler.
  • C. The PL/SQL program does not execute because an exception is not declared in the declare section.
  • D. An exception handler in the code traps the "no data found" error after executing the handler code and the program flow returns to the next line of code.


Answer : B

You want to maintain an audit of the date and time when each user of the database logs off.
Examine the following code:


Which two clauses should be used to fill in the blanks and complete the above code?
(Choose two.)

  • A. ON SCHEMA
  • B. ON QRXABASE
  • C. AFTER LOGOFF
  • D. BEFORE LOGOFF


Answer : A,D

Examine the following code:


What is the outcome?

  • A. The procedure is created successfully and displays the values 20 and 30 when it is called.
  • B. The procedure gives errors because the parameters should be in out mode.
  • C. The procedure gives errors because the host variables cannot be referenced anywhere in the definition of a PL/SQL stored procedure.
  • D. The procedure is created successfully but does not display any values when it is called because the host variables cannot be displayed inside the procedure.


Answer : C

View the Exhibit and examine the code.


Why does the code give an error on execution?

  • A. because the WORD_LIST variable is not visible in procedure wording
  • B. because the lexicon variable is not visible in procedure ADD_ENTRY
  • C. because the lexicon variable is not initialized in procedure wording
  • D. because the WORD_LIST parameter in out mode cannot be of a record data type


Answer : A

Examine the following partial code:


Which statement is correct about the unnamed block of code at the end of a package body?

  • A. It generates an error because all the blocks of code in a package body must be named.
  • B. It generates an error because V_TAXRATE is a public variable that is already initialized in the package specification.
  • C. It acts as a package initialization block that executes once, when the package is first invoked within the user session.
  • D. It acts as a package initialization block that executes each time a package subprogram is invoked within the user session and refreshes the initialized variable value.


Answer : C

Examine the following PL/SQL code:


Which statement is true about the execution of the PL/SQL code?

  • A. It executes successfully.
  • B. It generates a run-time exception.
  • C. It does not execute because of syntax error
  • D. It executes successfully and generates a warning.


Answer : B

Reference: http://docs.oracle.com/cd/B19306_01/appdev.102/b14261/errors.htm

Which two statements are true about the %ROWTYPE attribute? (Choose two.)

  • A. It is used to declare a record that can hold multiple rows of a table.
  • B. The attributes of fields in the record with the %ROWTYPE attribute can be modified manually.
  • C. The attributes of fields in the record take their names and data types from the columns of the table, view, cursor, or cursor variable.
  • D. It ensures that the data types of the variables that are declared with the %ROWTYPE attribute change dynamically when the underlying table is altered.


Answer : C,D

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

  • 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.


Answer : B,D

Reference: http://docs.oracle.com/cd/B10501_01/appdev.920/a96624/04_struc.htm

View the Exhibit and examine the package code created by SCOTT. The execute privilege on this package is granted to green.


Examine the following sequence of commands issued by SCOTT:

What is the outcome?

  • A. SCOTT’S session displays 5, and then 0, greets session displays 0.
  • B. SCOTT’S session displays 5, and then 0; green's session displays 5.
  • C. SCOTT’S session displays 5, and then 5 again, green's session displays 0.
  • D. SCOTT’S session displays 5, and then 5 again; green's session displays 5.


Answer : B

View the Exhibit to examine the PL/SQL block.


Which statement is true about the execution of the PL/SQL block?

  • A. It executes successfully and gives the desired output.
  • B. It does not execute because the definition of type population is indexed by VARCHAR2.
  • C. It executes, and the string keys of an associative array are not stored in creation order, but in sorted order.
  • D. It does not execute because the value that is once assigned to the element of the associative array cannot be changed.


Answer : A

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

  • 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.


Answer : A,C

Page:    1 / 7   
Total 103 questions