It's down to the client to interpret nested tables and display them. Unfortunately LiveSQL doesn't support this yet.
But plenty of other clients do! For example, in SQL*Plus you can see the contents:
SQL> CREATE TYPE Categories AS OBJECT(
2 priority VARCHAR2(10),
3 subcategory VARCHAR2(60)
4 );
5 /
Type created.
SQL>
SQL> CREATE TYPE CategoriesList AS TABLE OF Categories;
2 /
Type created.
SQL>
SQL> CREATE TABLE projekt (
2 projektname VARCHAR2(10),
3 categories CategoriesList)
4 NESTED TABLE categories STORE AS categories_tab;
Table created.
SQL>
SQL> INSERT INTO projekt VALUES('a',CategoriesList(Categories('1','subcat1'),
2 Categories('2','subcat4'),
3 Categories('3','subcat5')));
1 row created.
SQL>
SQL> INSERT INTO projekt VALUES('b',CategoriesList(Categories('1','subcat1'),
2 Categories('2','subcat3'),
3 Categories('3','subcat5')));
1 row created.
SQL>
SQL> INSERT INTO projekt VALUES('c',CategoriesList(Categories('1','subcat1'),
2 Categories('2','subcat2')));
1 row created.
SQL>
SQL> select * from projekt;
PROJEKTNAM
----------
CATEGORIES(PRIORITY, SUBCATEGORY)
--------------------------------------------------------------------------------------------------
a
CATEGORIESLIST(CATEGORIES('1', 'subcat1'), CATEGORIES('2', 'subcat4'), CATEGORIES('3', 'subcat5'))
b
CATEGORIESLIST(CATEGORIES('1', 'subcat1'), CATEGORIES('2', 'subcat3'), CATEGORIES('3', 'subcat5'))
c
CATEGORIESLIST(CATEGORIES('1', 'subcat1'), CATEGORIES('2', 'subcat2'))
You can also access the nested table elements using the table operator:
SQL> select t.*
2 from projekt p,
3 table (p.categories) t;
PRIORITY SUBCATEGORY
---------- ----------------------------------
1 subcat1
2 subcat4
3 subcat5
1 subcat1
2 subcat3
3 subcat5
1 subcat1
2 subcat2
This works in LiveSQL:
https://livesql.oracle.com/apex/livesql/file/content_EPTTKY4KPUCW0A444AZKQKX1F.html Finally, while you can store multiple values using nested tables, in the vast majority of cases you're better off using regular tables instead. This makes it easier to query and work with your data!