QuestionQ63

VerifiedPL/SQL Language Fundamentals

Examine these statements issued by user SH, which execute successfully:

Question Image

DBMS_OUTPUT.PUT_LINE(p_price(i));  
END LOOP;  
END;  
END products_pkg;  
/  

Now examine this anonymous block executed by SH:

Question Image

Which statement is true about the anonymous block?

Explanation

A collection type declared in a package specification is a distinct PL/SQL type and is incompatible with an identically defined local collection type. list1 has type products_pkg.PriceList, matching the formal parameter of products_pkg.print_price, so line 6 succeeds. list2 has the anonymous block’s local PriceList type, so passing it at line 7 raises a parameter type mismatch.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!