nerdexam
Oracle

1Z0-146 · Question #97

View Exhibit1 and examine the structure of the EMPLOYEES and DEPARTMENTS tables existing in your schem a. View Exhibit2 and examine the PL/SQL block that you execute to display the department-wise…

The correct answer is A. The cursor variable parameter should be passed in IN OUT mode. When you declare a cursor variable as the formal parameter of a subprogram that opens the cursor variable, you must specify the IN OUT mode. That way, the subprogram can pass an open cursor back to the caller.

Advanced PL/SQL Features

Question

View Exhibit1 and examine the structure of the EMPLOYEES and DEPARTMENTS tables existing in your schem a. View Exhibit2 and examine the PL/SQL block that you execute to display the department-wise incremented salary for all the departments in your company. The code generates an error on execution. What correction should be done to ensure the code executes successfully?

Exhibits

1Z0-146 question #97 exhibit 1
1Z0-146 question #97 exhibit 2

Options

  • AThe cursor variable parameter should be passed in IN OUT mode.
  • BThe cursor variable should be defined as a strong REF CURSOR type.
  • CThe cursor variable name passed as actual and formal parameters should be identical.
  • DThe %NOTFOUND cursor attribute cannot be used with the cursor variables and should be replaced

How the community answered

(24 responses)
  • A
    79% (19)
  • B
    4% (1)
  • C
    4% (1)
  • D
    13% (3)

Explanation

When you declare a cursor variable as the formal parameter of a subprogram that opens the cursor variable, you must specify the IN OUT mode. That way, the subprogram can pass an open cursor back to the caller.

Topics

#REF CURSOR#cursor variable parameter mode#IN OUT mode#weak cursor type

Community Discussion

No community discussion yet for this question.

Full 1Z0-146 Practice