Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: creating/using type dynamically
On Fri, 03 Mar 2006 22:32:37 GMT, j.w.vandijk.removethis_at_hetnet.nl
(Jaap W. van Dijk) wrote:
>On 3 Mar 2006 12:19:50 -0800, "hitchhikar" <reachsonu_at_gmail.com>
>wrote:
>
>>Hi frnds,
>>I am caught up in a very crazy yet obvious situation using pl/sql.
>>I wil try to explain the issue here in hope of gettin some
>>pointers/help
>>
>>I want to create a type based on the string which is my input parameter
>>and then use that type.
>>For eg,
>>
>>BEGIN
>>....
>><some code>
>>....
>>EXECUTE IMMEDIATE
>>'CREATE TYPE myType AS TABLE OF '|| tblname ||'%ROWTYPE INDEX BY
>>BINARY_INTEGER;';
>>mytyp_var myType;
>>....
>><code>
>>END;
>>
>>
>>Now this wil create tht myType at runtime but the problem is compiling
>>this piece of code as myType has nt been declared at the time of use.
>>Is there a workarnd for this??where i can create and use on
>>runtime...dynamically
>>
>>TIA
>>
>
>If you only gonna use the type in the code that follows the type
>specification, you don't need to create a TYPE object in the database.
>Just declare a type in the PL/SQL-code:
>
>BEGIN
>....
><some code>
>....
>TYPE myType AS TABLE OF '|| tblname ||'%ROWTYPE INDEX BY
>BINARY_INTEGER;';
>mytyp_var myType;
>....
><code>
>END;
>
>Jaap.
Sorry, misread you're requirement. My suggestion is not going to work.
Jaap. Received on Fri Mar 03 2006 - 16:56:22 CST