Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> using SELF in object method
Hi all,
I'm experiencing some difficulties working with object's methods with
Oracle 10g. I'm trying to build a set of methods that manage some nested
tables used into an object, but I've found some problems when working
with the self parameter.
In order to retrieve the right and unique object to update from the
table I need to know the invoker's ref. Well I've tried for long to use
the REF function with the self parameter without any success! It's due
to the REF definition that need a correlation parameter as argument I
think. So something like
select ref(self) into var from dual;
won't work. I've used this trick even with other variables but nothing
happened so it seems a limit of ref function. Well I dunno now how to
get the ref I need...is the only one thing to do to pass the right ref
as parameter completely ignoring self?? It's not exactly an elegant
solution in my opinion...
I'm wondering why they passed self as object and not as ref of
object!!With the ref I would have done all tasks even cause the deref
function is designed to take all parameters insted, not only correlation
ones!!!
My second problem was found when trying to update object's attribute
using self!Well something like self.attribute:= value affects the object
only within the method. When I query the table the object is exactly as
before calling the method....
I've tried even explicitly declaring the self parameter as "IN OU" even
with the "NO COPY" compiler directive without any success. If the object
is passed to method not copying itself...why the changes doesn't remain
outside the procedure???
Sorry for the long message...I've tried to explain all in few words..but
as you cans see...my doubt aren't few. I hope to read some suggestion
from more experienced users...tnx everyone.
Best regards,
Davide
Received on Thu Aug 03 2006 - 05:57:23 CDT
![]() |
![]() |