Oracle Magazine, May/June 2019
Database Developer PL SQL still do write lots of PL SQL code most recently for the Oracle Dev Gym an activelearning website featuring quizzes workouts and classes And thats why my favorite PL SQL enhancement in Oracle Database 18c is the qualified expression If you are not familiar with that term then how about constructor ORACLE MAGAZINE MAY JUNE 2019 77 function Ever since Oracle Database introduced the object relational model in version 8 PL SQL developers been able to use constructor functions to well construct nested tables varrays and object type instances A constructor function is a function created implicitly by Oracle Database that has the same name as its type The easiest way to understand constructor functions is to look at an example To initialize a nested table of integers with three elements I can do this DECLARE TYPE numbers_ t IS TABLE OF NUMBER l_ numbers numbers_ t numbers_ t 1 2 3 3 BEGIN DBMS_ OUTPUT put_ line l_ numbers COUNT END So numbers_ t is the name of the type but it is also the name of a function For a nested table or varray type I simply pass in a list of expressions and the function returns a collection populated with those values If I dont pass in any values and simply call the constructor function then the collection will be initialized but will be empty But before Oracle Database 18c if I was using an associative array aka an
You must have JavaScript enabled to view digital editions.