Path: dp-news.maxwell.syr.edu!spool.maxwell.syr.edu!drn.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newshosting.com!nx02.iad01.newshosting.com!207.115.63.142.MISMATCH!newscon02.news.prodigy.com!prodigy.net!newsmst01a.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr13.news.prodigy.com.POSTED!af4f5987!not-for-mail
From: Mark Bole <makbo@pacbell.net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: comp.databases.oracle.misc,comp.lang.java.programmer,comp.databases.oracle.server
Subject: Re: Associative arrays in Oracle PL/SQL as parameters, use with Java
References: <1109889975.725357.101370@f14g2000cwb.googlegroups.com> <287f219f94q90bj36nfra05c1n2oqt8b4h@4ax.com> <NeOVd.11106$Pz7.8527@newssvr13.news.prodigy.com>
In-Reply-To: <NeOVd.11106$Pz7.8527@newssvr13.news.prodigy.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 63
Message-ID: <qCOVd.11109$Pz7.4439@newssvr13.news.prodigy.com>
NNTP-Posting-Host: 69.109.208.116
X-Complaints-To: abuse@prodigy.net
X-Trace: newssvr13.news.prodigy.com 1109898774 ST000 69.109.208.116 (Thu, 03 Mar 2005 20:12:54 EST)
NNTP-Posting-Date: Thu, 03 Mar 2005 20:12:54 EST
Organization: SBC http://yahoo.sbc.com
X-UserInfo1: FKPO@MC@OHUQRS@YABCD^VX@WB]^PCPDLXUNNHPIMASJETAANVW[AKWZE\]^XQWIGNE_[EBL@^_\^JOCQ^RSNVLGTFTKHTXHHP[NB\_C@\SD@EP_[KCXX__AGDDEKGFNB\ZOKLRNCY_CGG[RHT_UN@C_BSY\G__IJIX_PLSA[CCFAULEY\FL\VLGANTQQ]FN
Date: Fri, 04 Mar 2005 01:12:54 GMT
Xref: dp-news.maxwell.syr.edu comp.databases.oracle.misc:116985 comp.lang.java.programmer:499212 comp.databases.oracle.server:237437

Mark Bole wrote:

> Sybrand Bakker wrote:
> 
>> On 3 Mar 2005 14:46:15 -0800, googledude@hotmail.com wrote:
>>
>>
>>> Is it possible to pass Oracle associative arrays as PL/SQL parameters ?
>>> I have basically gone through a bunch of articles on Oracle's site,
>>> google, search engine. I have yet to find any decent examples of using
>>> associative arrays as parameters.
>>>
>>> I am shocked/surprised that a company of the size of oracle has such
>>> poor search tools on their web site with tons of irrelevant
>>> information. I also tried to look through the O'Reilly books on PL/SQL
>>> (3rd edition). The book has no contextual coverage on my problem (it is
>>> loaded with elementary type information and examples). As you can tell,
>>> I am frustrated and can't find any in-depth coverage on this issue.
>>>
>>> 1. Can I use associative arrays (specifically the ones indexed by
>>> varchar2) as parameters between various pl/sql functions/procedures ?
>>>
>>> 2. What, if any, corresponding data structures and constructs can be
>>> used on the java side to map to associative arrays (NO, i am not
>>> interested in using varrays and/or nested tables).
>>>
>>> 3. Anyone care to share any examples that use these features ?
>>>
>>> Thanks humbly for your help in advance!
>>
>>
>>
>> 1 Anything with a type definition can be passed within pl/sql
>>
>> 2 that I don't know.
>>
>>
>> -- 
>> Sybrand Bakker, Senior Oracle DBA
> 
> 
> PL/SQL associative arrays are relatively new, only since version 9.2, 
> which might be why examples are not abundant.
> 
> Not a Java programmer, but java.util.Hashtable class ought to get you 
> started on question 2.
> 
> http://java.sun.com/j2se/1.4.2/docs/api/java/util/Hashtable.html
> 
> -Mark Bole
> 
> 
> 

Make that class java.util.Map instead, which actually ensures unique 
keys.  Consider also Perl instead of Java if you have a choice (not 
really knowing what you want to do, but if it depends heavily on 
associative arrays, Perl is really good at that).

-Mark Bole



