CREATE OR REPLACE TYPE test1_type AS OBJECT
(
SOURCE_ID NUMBER(10),
ENTITY_ID_CODE VARCHAR2(3 Byte)
)
CREATE OR REPLACE TYPE test1_type_tbl
AS TABLE OF test1_type;
CREATE OR REPLACE TYPE test2_type AS OBJECT
(
RECEIVER_ID NUMBER(10),
SOURCE_ID NUMBER(10)
)
CREATE OR REPLACE TYPE test2_type_tbl
AS TABLE OF test2_type;
CREATE OR REPLACE TYPE wrapper_type AS OBJECT
(
test_nested_input1 test1_type_tbl,
test_nested_input2 test2_type_tbl
)
CREATE OR REPLACE TYPE wrapper_type_tbl
AS TABLE OF wrapper_type;
create table REALMED_CORP_NESTED_TABLE
(
id INTEGER Primary Key,
Company_Name VarChar2(20),
wrapper_rec wrapper_type_tbl
)
NESTED TABLE wrapper_rec STORE AS nested_wrapper_rec
(NESTED TABLE test_nested_input1 STORE AS nested_Input1_tab
NESTED TABLE test_nested_input2 STORE AS nested_Input2_tab);
insert into REALMED_CORP_NESTED_TABLE
values
(001,
'c12',
wrapper_type_tbl(
wrapper_type(
test1_type_tbl(test1_type(12,'t')),
test2_type_tbl(test2_type(12,12))
))
);
commit
select DBMS_XMLquery.GetXML('select * from REALMED_CORP_NESTED_TABLE') from dual
Halim, a Georgia Tech graduate Senior Database Engineer/Data Architect based in Atlanta, USA, is an Oracle OCP DBA and Developer, Certified Cloud Architect Professional, and OCI Autonomous Database Specialist. With extensive expertise in database design, configuration, tuning, capacity planning, RAC, DG, scripting, Python, APEX, and PL/SQL, he combines technical mastery with a passion for innovation. Notably, Halim secured 16th place worldwide in PL/SQL Challenge Cup Playoff on the year 2010.
Saturday, September 12, 2009
Subscribe to:
Post Comments (Atom)
My Blog List
-
-
-
ASSM states3 weeks ago
-
UKOUG Discover 20241 month ago
-
-
-
-
-
-
-
-
Moving Sideways8 years ago
-
-
Upcoming Events...11 years ago
-
No comments:
Post a Comment