Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Genereic reference type in PL/SQL?
Thomas Blankschein (thomas_at_blankschein.de) wrote:
: Hello,
: I work with Oracle 9.2.0.7 Standard.
: I know about the REF CURSOR type. But is it possible to create and use
: references for other types, like pointers in C/C++?
Yes (but not as "pointers to memory").
Do it the same as in java, using objects.
Create a base object class, and use an object of that type as your formal parameter to a procedure.
At run time, create an instance of an appropriate sub-class and pass that as the real parameter.
The run-time behaviour will then vary depending on the type of object.
Java books are full of examples of coding patterns that can be used to implement behaviour that is similar in effect to using C-like pointers.
One thing to beware is to not include your class types within the datamodel because you end up with all sorts of unanticipated headaches, but using them in your pl/sql code is not a problem.
$0.10 Received on Tue Oct 17 2006 - 17:16:30 CDT