Oracle project tables need to be used in recent projects
I learned a bit.
The Code is as follows:
SQL> Create type depscore_t as object (
2 depid number,
3 score number );
4/
Type already created.
SQL> Create type depscores_t as table of depscore_t;
2/
Type already created.
SQL> Create Table befscore (proid number,
2 depscore depscores_t)
3 nested table depscore store as depscoretab;
The table has been created.
1 * insert into befscore values (1, depscores_t (depscore_t (), depscore_t )))
SQL>/
One row has been created.
SQL> insert into befscore values (2, depscores_t (depscore_t (2, 2), depscore_t (3, 4 )));
One row has been created.
SQL> insert into befscore values (3, depscores_t (depscore_t (3, 5), depscore_t (5, 5 )));
One row has been created.
SQL> select * From befscore where proid = 1;
Proid
----------
Depscore (depid, score)
--------------------------------------------------------------------------------
1
Depscores_t (depscore_t (1, 1), depscore_t (2, 2 ))
SQL> select e. * From befscore, table (depscore) e where proid = 1;
Depid score
--------------------
1 1
2 2
SQL> select e. depid from befscore, table (depscore) e where proid = 1;
Depid
----------
1
2
SQL> select value (e) from befscore, table (depscore) E;
Value (E) (depid, score)
--------------------------------------------------------------------------------
Depscore_t (1, 1)
Depscore_t (2, 2)
Depscore_t (2, 2)
Depscore_t (3, 4)
Depscore_t (3, 5)
Depscore_t (5, 5)
You have selected 6 rows.
SQL> Update befscore set depscore = depscores_t (depscore_t (8, 8), depscore_t (7, 7 ))
2 Where proid = 1;
1 row updated.
1 * select e. depid, score from befscore, table (depscore) E
SQL>/
Depid score
--------------------
2 2
3 4
3 5
5 5
8
7
You have selected 6 rows.
SQL> select e. depid ID, score depscore from befscore, table (depscore) E;
Id depscore
--------------------
2 2
3 4
3 5
5 5
8
7
You have selected 6 rows.