Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Genereic reference type in PL/SQL?

Re: Genereic reference type in PL/SQL?

From: Martin T. <bilbothebagginsbab5_at_freenet.de>
Date: 12 Oct 2006 13:50:06 -0700
Message-ID: <1160686205.941381.39790@i42g2000cwa.googlegroups.com>


Thomas Blankschein 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++?
>
> Here is a pseudocode example of what I want to achieve. In this special
> case I can of course use an array. It's just an example.
>
> CREATE OR REPLACE FUNCTION ref_test(p_Index IN NUMBER) RETURN VARCHAR2
> IS
> strText1 VARCHAR2(10);
> strText2 VARCHAR2(10);
> strText3 VARCHAR2(10);
> pointer_to_varchar REF VARCHAR2; <--- ???
>
> BEGIN
>
> strText1 := 'One';
> strText2 := 'Two';
> strText3 := 'Three';
>
> -- Set the reference to the right variable, depending on the
> -- index parameter
> IF p_Index = 1 THEN pointer_to_varchar := REF(strText1); <--- ???
> IF p_Index = 2 THEN pointer_to_varchar := REF(strText2); <--- ???
> IF p_Index = 3 THEN pointer_to_varchar := REF(strText3); <--- ???
>
> -- Returning the text
> RETURN DEREF(pointer_to_varchar); <--- ???
>
> END;
Never seen it in PL/SQL. I'd say it's not possible. Any specific requirement you'd need it for?

cheers,
Martin Received on Thu Oct 12 2006 - 15:50:06 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US