Posts

Showing posts from August, 2017

Custom DataType in Oracle Database.

Oracle provides the predefined types which developer can use in the PL/SQL. Those types are like NUMBER, ARRAYOFNUMBERS, VARCHAR2 and many more.  Developer who consumes PL/SQL from JAVA can easily use those types in case of normal scenario. But consider a scenario where, developer want to send collections to PL/SQL, then how that would be possible. So, oracle have provided an option to create own custom types as per requirement and use that types in PL/SQL. That custom type support essay access to data types from JAVA and speed up execution and developer can achieve performance too. Syntax of creation of custom type:- #1 TABLEOF3STRINGS:- create or replace TYPE "TRIPLETOFSTRINGS" as object (field1 varchar2(20), field2 varchar2(20), field3 varchar2(20)); create or replace TYPE "TABLEOF3STRINGS" as table of TripletOfStrings; #2 Structure with number field:- create or replace TYPE "LINEITEM" as object ( item_name varchar2(30), quanti