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

Home -> Community -> Usenet -> c.d.o.server -> Re: multi-valued field?

Re: multi-valued field?

From: Steve Behman <sbehman_at_ibm.net>
Date: 1997/01/07
Message-ID: <32D2B6EB.3A22@ibm.net>#1/1

Tony Vuong wrote:
>
> Record Multi-Values
> 1 a, b, c, d
> 2 a, b
> 3 d, e
> 4 b, c
>
> During runtime, I would like to achieve a way of "breaking-up", or
> "component-erizing" the Multi-Values into a dynamically created components
> table so that operations involving sets and subsets can be performed on this
> components table. One such components table might be:
>
> Id Single-Value
> 1 a
> 1 b
> 1 c
> 1 d
> 2 a
> 2 b
> 3 d
> 3 e
> 4 b
> 4 c
>
> The question is whether I can do the break-up with only SQL statements (without
> procedural SQL like PL/SQL)? If not, then can I do it with procedural-SQL?
> At present, I am restricted to using only SQL, so I am very much interested in
> the first approach. However, if it is impossible to do it with SQL, then I'd
> also like to get help on how that can be done with procedural-SQL.
>

O.K. But let me warn you I believe that you are probably overconstraining the problem and probably will not like a VERY GENERAL solution!

So, We'll need some more basic info:

Why do you feel that the "," delimiters are needed?

How many values can the "single-value" value assume? (e.g. a-m would be 13 distinct values.)

At most how many of these values can this field accomodate? (the max in your example is the first row which takes on 4 values.)

Can a value be repeated? (e.g. a,a,c,d)

Are the values ORDERED?

Fundamentally I am asking: What is there that is internal to the problem that would let the solution be simpler?

Steve Behman
<sbehman_at_ibm.net> Received on Tue Jan 07 1997 - 00:00:00 CST

Original text of this message

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