Takes a nested table and returns a nested table of nested tables containing all nonempty subsets (called submultisets) of the input nested table
Note: This demo, and the following two, are copied from the tahiti docs but put onto a single page to make using them easier
POWERMULTISET(<expression>)
conn oe/oe@pdbdev
CREATE TABLE customers_demo AS
SELECT * FROM customers;
CREATE OR REPLACE TYPE cust_address_tab_typ AS
TABLE OF cust_address_typ;
/
ALTER TABLE customers_demo
ADD (cust_address_ntab cust_address_tab_typ, cust_address2_ntab cust_address_tab_typ)
NESTED TABLE cust_address_ntab STORE AS cust_address_ntab_store
NESTED TABLE cust_address2_ntab STORE AS cust_address2_ntab_store;
UPDATE CUSTOMERS_DEMO cd
SET cust_address_ntab =
CAST(MULTISET(SELECT cust_address
FROM customers c
WHERE c.customer_id =
cd.customer_id) as cust_address_tab_typ);
UPDATE CUSTOMERS_DEMO cd
SET cust_address2_ntab =
CAST(MULTISET(SELECT cust_address
FROM customers c
WHERE c.customer_id =
cd.customer_id) as cust_address_tab_typ);
COMMIT;
SELECT parent_table_name, table_name, table_type_name
FROM user_nested_tables;
CREATE OR REPLACE TYPE cust_address_tab_tab_typ
AS TABLE OF cust_address_tab_typ;
/
SELECT CAST(POWERMULTISET(cust_address_ntab) AS cust_address_tab_tab_typ)
FROM customers_demo;
Takes a nested table and a cardinality and returns a nested table of nested tables containing all non-empty subsets (called submultisets) of the nested table of the specified cardinality