Oracle Database: Program with PL/SQL — Question 38
Examine this function call:
cur_num := DBMS_SQL.TO_CURSOR_NUMBER (cur_val);
Which two statements are true?
Answer options
- A. CUR_VAL must be opened after this line is executed in the PL/SQL block.
- B. CUR_VAL must be a weakly typed cursor variable.
- C. CUR_VAL can be either a strongly or weakly typed cursor variable.
- D. CUR_VAL must be opened before this line is executed in the PL/SQL block.
- E. The PL/SQL block can continue to use the cursor variable after this line is executed.
Correct answer: B, C
Explanation
Option B is correct because CUR_VAL is required to be a weakly typed cursor variable for the DBMS_SQL.TO_CURSOR_NUMBER function to work. Option C is also correct because CUR_VAL can be either a strongly typed or weakly typed cursor variable, allowing flexibility in its usage. The other options are incorrect as CUR_VAL does not need to be opened before or after this line, and the PL/SQL block can continue to use the cursor variable without issue.