调用成员过程NULL SELF参数Oracle [英] Calling member procedure NULL SELF argument Oracle
本文介绍了调用成员过程NULL SELF参数Oracle的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个用成员过程insert_obj
声明的类型myType
.
I have a type myType
declared with a member procedure insert_obj
.
当我尝试此代码时,出现以下错误:
When i try this code, i get the following error:
declare
v_obj myType;
begin
v_obj.insert_obj(1,2,3);
end;
ORA-30625: method dispatch on NULL SELF argument is disallowed
我认为这是因为我没有对象可以调用该方法...
I am assuming this is because i have no object on which to call the method...
但我做不到
select value(a) into v_obj from myTable
因为表是空的(我想插入其中).
because the table is empty (and i want to insert into it).
那我如何获得一个对象来调用我的方法?
How then do i get an object to call my method on?
谢谢
推荐答案
您可以使用构造函数:
v_obj myType := new myType();
这篇关于调用成员过程NULL SELF参数Oracle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文