Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: create/using type dynamically
hitchhikar 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
What is the business case? And what is it you are trying to say when you
write "create tht myType at runtime"?
You will undoubtedly want the TYPE defined in the data dictionary as a permanent object.
-- Daniel A. Morgan http://www.psoug.org damorgan_at_x.washington.edu (replace x with u to respond)Received on Fri Mar 03 2006 - 14:36:36 CST