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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Array Implementation in Oracle

Re: Array Implementation in Oracle

From: Keith Jamieson <pdkj02_at_email.mot.com>
Date: Thu, 18 Feb 1999 14:45:16 +0000
Message-ID: <36CC277C.1BBD3149@email.mot.com>


What you really want here is a tablw with 51 columns, with the first column
being the key.

so your create table would be something like
create table example(month number(2),
                                col1    datatype,
                                col2     datatype,
                             ... etc,
                               col49 datatype,
                               col50);
Assuming you have numbers 1 to 12 representing months January to december
to select all records for february you could use
select * from
example
where month = 2;

You could vastly improve flexibility by storing the date and time the record was linserted/updated rather than use specific months.
Then you could search foer all records between any two specified date and times.
bounasall@hotmail.com wrote:

here is an example. Let's say we want to have an array of all the months in a
year(this is just an example, in my actual design I have a 50 field array). I
want to be able to retrieve info for the month of february by requesting the
content of the second field of the array, or lets say month[2] assuming index
0 is empty. How would I implement this an oracle table?

Thanks for your help
Bouna

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own

  Received on Thu Feb 18 1999 - 08:45:16 CST

Original text of this message

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