Oracle 内存中的对象表
我有以下类型:
create or replace type autocontrole2.DifferentStatesSAC as object (
AUTOCONTROLE_STATUS_CODE_ID NUMBER(2),
DATUM_BEGIN DATE,
DATUM_EIND DATE)
使用以下 SQL,错误是“ORA 06531 - 对未初始化集合的引用”
declare
type TableDifferentStatesSAC is table of autocontrole2.DifferentStatesSAC;
StatutenSAC TableDifferentStatesSAC;
begin
StatutenSAC(1).AUTOCONTROLE_STATUS_CODE_ID := 6;
StatutenSAC(1).DATUM_BEGIN := sysdate;
StatutenSAC(1).DATUM_EIND := sysdate;
end;
使用以下 SQL,错误是“调用 DifferentStatesSAC() 时类型或参数的数量错误”:
declare
type TableDifferentStatesSAC is table of autocontrole2.DifferentStatesSAC;
StatutenSAC TableDifferentStatesSAC := autocontrole2.DifferentStatesSAC;
begin
StatutenSAC(1).AUTOCONTROLE_STATUS_CODE_ID := 6;
StatutenSAC(1).DATUM_BEGIN := sysdate;
StatutenSAC(1).DATUM_EIND := sysdate;
end;
我想要在内存中创建一个“表”,其中包含一个具有 3 个值的对象。
有什么想法可以将对象添加到该表中吗?
I've got the following type:
create or replace type autocontrole2.DifferentStatesSAC as object (
AUTOCONTROLE_STATUS_CODE_ID NUMBER(2),
DATUM_BEGIN DATE,
DATUM_EIND DATE)
With the following SQL, the error is "ORA 06531 - reference to uninitialized collection"
declare
type TableDifferentStatesSAC is table of autocontrole2.DifferentStatesSAC;
StatutenSAC TableDifferentStatesSAC;
begin
StatutenSAC(1).AUTOCONTROLE_STATUS_CODE_ID := 6;
StatutenSAC(1).DATUM_BEGIN := sysdate;
StatutenSAC(1).DATUM_EIND := sysdate;
end;
With the following SQL, the error is "wrong number of types or arguments in call to DifferentStatesSAC()":
declare
type TableDifferentStatesSAC is table of autocontrole2.DifferentStatesSAC;
StatutenSAC TableDifferentStatesSAC := autocontrole2.DifferentStatesSAC;
begin
StatutenSAC(1).AUTOCONTROLE_STATUS_CODE_ID := 6;
StatutenSAC(1).DATUM_BEGIN := sysdate;
StatutenSAC(1).DATUM_EIND := sysdate;
end;
I want to create a 'table' in memory that contains an object with 3 values.
any ideas how I can add objects to this table?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要初始化嵌套表:
您还可以使用单个命令填充该表:
在 在线文档。
You need to initialize the nested table:
You can also fill the table with a single command:
Find out more in the online documentation.