Possible to create Oracle Database object types inside of PL/SQL?(可以在 PL/SQL 内部创建 Oracle 数据库对象类型吗?)
问题描述
是否可以在 Oracle 数据库 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.
谢谢,杰夫
推荐答案
来自Oracle 10g 文档:
目前,您无法定义对象PL/SQL 块、子程序、或包.
Currently, you cannot define object types in a PL/SQL block, subprogram, or package.
所以,不幸的是,没有.
So, unfortunately, no.
这篇关于可以在 PL/SQL 内部创建 Oracle 数据库对象类型吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:可以在 PL/SQL 内部创建 Oracle 数据库对象类型吗?
基础教程推荐
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- 带更新的 sqlite CTE 2022-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- 带有WHERE子句的LAG()函数 2022-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
