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

Home -> Community -> Usenet -> c.d.o.tools -> Re: What is the best PLSQL solution to this problem?

Re: What is the best PLSQL solution to this problem?

From: Daniel A. Morgan <dmorgan_at_exesolutions.com>
Date: Tue, 19 Jun 2001 23:05:55 -0700
Message-ID: <3B303D43.AD5FAA2D@exesolutions.com>

javadude wrote:

> I need repetitive access to a data structure that consists of
>
> KEYWORD ARRAY (the values are separated by commas)
> ------- ----------------------------
> key1 12,N,N,4
> key2 5,N,23,24,26,N,N,N
> key3 1,2,5,6,7,8
> .
> .
> .
> N; where N < 30
>
> and want the best performance.
>
> I want to do it in PL/SQL only with NO tables being created in the
> database. Since, no
> one in the group is familiar with Oracle objects except me and I have
> just started using them so I would like to avoid them if there is way to
> do it without them. DB version is 8.1.7 and beyond. Essentially what I
> want is a hash of arrays, which in Perl is so easy to do but how do you
> do it in PLSQL given the constraints mentioned?
>
> ?

You need repetitive access? Or you need to read the field and parse it? And why oh why oh why don't you have your data normalized?

If you need to parse it you can do it a number of ways. One that is easy to write is to use INSTR to determine the locations of the commas and then SUBSTR what is between them.

Daniel A. Morgan Received on Wed Jun 20 2001 - 01:05:55 CDT

Original text of this message

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