Witam :)
Korzystając z dobrodziejstw aspektów programowania obiektowego w Oraclu postanowiłem stworzyć następującą strukturę z tabelami:
- Bosses (tabela z listą managerów)
-
- Managers (tabela z listą pracowników)
-
-
- Employees
-
Gdy próbuję odpalić poniższy kod:
-- TYP: Pracownik (bazowy)
create or replace
TYPE type_Employee AS OBJECT (
name VARCHAR2(30),
department_name VARCHAR2(30),
second_name VARCHAR2(30),
manager REF type_Employee
);
-- lista dla Zarzadcow Wydzialow
CREATE or replace TYPE type_ListEmployees
AS TABLE OF type_Employee;
-- TYP: Zarzadcy wydzialow
create or replace
TYPE type_Manager AS OBJECT (
userData type_Employee,
manager REF type_Employee,
listEmployees type_ListEmployees
);
NESTED TABLE listEmployees STORE AS tab_univ_employees
-- lista dla Bossow
CREATE or replace TYPE type_ListManagers
AS TABLE OF type_ListEmployees;
-- TABELA BAZOWA: Bossowie katedry
CREATE TABLE tab_it_structure (
id NUMBER PRIMARY KEY,
userData type_Employee,
managers type_ListManagers
);
NESTED TABLE managers STORE AS tab_univ_managers
Otrzymuję następujący exception:
Error at Command Line:31 Column:3
Error report:
SQL Error: ORA-22913: "must specify table name for nested table column or attribute"
*Cause: The storage clause is not specified for a nested table column
or attribute.
*Action: Specify the nested table storage clause for the nested table
column or attribute.
Error starting at line 33 in command:
NESTED TABLE managers STORE AS tab_univ_managers
Error report:
Unknown Command
Skrypt wykrzacza się w tej linijce:
NESTED TABLE managers STORE AS tab_univ_managers
Czy ktoś miałby pomysł dlaczego tak jest?
Pozdrawiam.
Wicia