@orpha
You can delete null elements from a nested table in Oracle using the following steps:
1 2 3 4 5 6 7 8 9 10 11 |
DECLARE TYPE NestedTableType IS TABLE OF VARCHAR2(100); nt NestedTableType := NestedTableType('A', null, 'B', null, 'C'); BEGIN FOR i IN nt.FIRST .. nt.LAST LOOP IF nt(i) IS NULL THEN nt.DELETE(i); END IF; END LOOP; END; |
In this example, we have a nested table nt
containing elements 'A', null, 'B', null, 'C'. We loop through the elements of the nested table and use the DELETE method to remove the null elements.
After running the above code, the nested table nt
will only contain elements 'A', 'B', 'C' without any null elements.