如何在oracle11g中定义一个引用该类型集合的类型? [英] How can I define a type in oracle11g that references a collection of that type?

查看:380
本文介绍了如何在oracle11g中定义一个引用该类型集合的类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想这样做

create type Item as object (
    id number,
    subitems table of ref Item
)

但是oracle抛出异常,当我尝试做它。这是可能的,如果是,那么如何?

but oracle throws an exception when I try to do it. Is this possible, and if yes then how?

推荐答案

Oracle不会编译您的定义,因为项目尚未编译。为什么不试试:

Oracle will not compile your definition because the type Item hasn't been compiled yet. Why dont you give this a try:

编译:

CREATE OR REPLACE TYPE Item;

CREATE OR REPLACE TYPE items_table IS TABLE OF REF item;

,然后尝试:

CREATE OR REPLACE TYPE item AS OBJECT (
   id number,
   subitems items_table
)

这篇关于如何在oracle11g中定义一个引用该类型集合的类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆