Path: dp-news.maxwell.syr.edu!spool.maxwell.syr.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!proxad.net!fdn.fr!freenix!sn-xt-sjc-15!sn-xt-sjc-06!sn-post-01!supernews.com!corp.supernews.com!not-for-mail
From: DA Morgan <damorgan@psoug.org>
Newsgroups: comp.databases.oracle.misc
Subject: Re: create/using type dynamically
Date: Fri, 03 Mar 2006 12:36:36 -0800
Organization: Ye 'Ol Disorganized NNTPCache groupie
Message-ID: <1141418189.459918@jetspin.drizzle.com>
User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)
X-Accept-Language: en-us, en
MIME-Version: 1.0
References: <1141417234.983818.20650@z34g2000cwc.googlegroups.com>
In-Reply-To: <1141417234.983818.20650@z34g2000cwc.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cache-Post-Path: jetspin.drizzle.com!unknown@oracle.advtechserv.com
X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/)
X-Complaints-To: abuse@supernews.com
Lines: 40
Xref: dp-news.maxwell.syr.edu comp.databases.oracle.misc:125679

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@x.washington.edu
(replace x with u to respond)
