Just like selecting data, you can use the table operator to update "rows" of your nested table:
CREATE TYPE Categories AS OBJECT(
priority VARCHAR2(10),
subcategory VARCHAR2(60)
);
/
CREATE TYPE CategoriesList AS TABLE OF Categories;
/
CREATE TABLE projekt (
projektname VARCHAR2(10),
categories CategoriesList)
NESTED TABLE categories STORE AS categories_tab;
INSERT INTO projekt VALUES('a',CategoriesList(Categories('1','subcat1'),
Categories('2','subcat4'),
Categories('3','subcat5')));
INSERT INTO projekt VALUES('b',CategoriesList(Categories('1','subcat1'),
Categories('2','subcat3'),
Categories('3','subcat5')));
INSERT INTO projekt VALUES('c',CategoriesList(Categories('1','subcat1'),
Categories('2','subcat2')));
commit;
update table(
select categories
from projekt
where projektname = 'a'
)
set subcategory = 'TEST'
where priority = 1;
select c.*
from projekt p,
table(p.categories) c;
PRIORITY SUBCATEGORY
1 TEST
2 subcat4
3 subcat5
1 subcat1
2 subcat3
3 subcat5
1 subcat1
2 subcat2
A good example of why I don't like storing nested tables: they make all your SQL more complicated!