是否可以通过查询自动填充嵌套表?也许通过物化视图?像铁
CREATE OR REPLACE TYPE also_bought_type AS OBJECT (
also_bought_movie REF MOVIE_TYPE)
/
CREATE OR REPLACE TYPE also_bought_tab_type
AS TABLE OF also_bought_type
/
CREATE OR REPLACE TYPE movie_type AS OBJECT (
title VARCHAR2(64),
also_bought also_bought_tab_type)
/
create table movie of movie_type
object id system generated
/
现在also_bought_type(嵌套表)应该从辅助表中填充:
create or replace TYPE purchases_type as object
(
movie_1 REF MOVIE_TYPE,
movie_2 REF MOVIE_TYPE,
purchases number
)
/
create table purchases of purchases_type
object id system generated
/
使用查询与购买该电影的其他电影进行检查。