可以在PL/SQL内部创建Oracle数据库对象类型吗? [英] Possible to create Oracle Database object types inside of PL/SQL?

查看:43
本文介绍了可以在PL/SQL内部创建Oracle数据库对象类型吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在Oracle Database 10g中的包内部创建对象类型?像这样:

Is it possible to create an object type inside of a package in Oracle Database 10g? Something like:

create or replace package my_package as 
    type my_type as object (
        id number(15) 
     ); 
end;

赠予:

错误(3,9):PLS-00540:此上下文中不支持该对象.

Error(3,9): PLS-00540: object not supported in this context.

我最终希望做的是使用多态性,但也允许对象访问表并使用PL/SQL,这在程序包外部定义的类型中是不允许的.

What I'm ultimately looking to be able to do is use polymorphism but also allow the objects to access tables and use PL/SQL, which isn't allowed in types defined outside of packages.

谢谢, 杰夫

推荐答案

来自

当前,您无法定义对象 PL/SQL块中的类型,子程序, 或包裹.

Currently, you cannot define object types in a PL/SQL block, subprogram, or package.

不幸的是,不.

这篇关于可以在PL/SQL内部创建Oracle数据库对象类型吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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