This content has been marked as final. Show 4 replies
I'm not sure I follow all of what you are trying to achieve but I think I have a couple ideas around it.
You can get a ref to a local object like this:
my_obj my_obj_type := my_obj_type (null);
my_obj_ref ref my_obj_type;
select ref(my_obj) into my_obj_ref from dual;
I think what you want is a member function that returns a reference to itself.
I would expect that you could try something like the above within the member function and return the resulting ref. I have not tried this though.
if you use object views instead of object tables, it's as easy to construct a 'self-reference' attribute as an other REF attribute, use MAKE_REF:
Hope this helps.
create or replace view V_My_View of TMyObject with object identifier (key1, key2, ...) as select t.key1 , t.key2 , ... , make_ref(V_My_View, t.key1, t.key2, ...) as selfRef , ... from T_My_Table t where ...