开发者

Calling member procedure NULL SELF argument Oracle

开发者 https://www.devze.com 2022-12-21 04:18 出处:网络
I have a type myType declared with a member procedure insert_obj. When i try this code, i get the following error:

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 tabl开发者_Go百科e is empty (and i want to insert into it).

How then do i get an object to call my method on?

Thanks


You can use a constructor:

v_obj myType := new myType();
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号