Calling member procedure NULL SELF argument Oracle

安稳与你 提交于 2020-01-03 02:32:05

问题


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...

but i cannot do

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?

Thanks


回答1:


You can use a constructor:

v_obj myType := new myType();


来源:https://stackoverflow.com/questions/2319022/calling-member-procedure-null-self-argument-oracle

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!