Code for "bucket-ized" time table???

Code for "bucket-ized" time table???

Post by New G » Thu, 20 May 2004 08:14:33



Hello,

First, I want to apologize for posting this message to multiple
groups. (1) I have a hard time finding any info and (2) this is not a
school assignment.

I am trying to create in my Oracle test database a "time" table that
would have time buckets. What I mean is that, it would have some
structure like this

0-5 minute bucket
10-15 minute bucket
15-20 minute bucket
...
55-60 minute bucket
0-2 hour bucket
2-4 hour bucket
4-6 hour bucket
...
22-24 hour bucket
day number
week number
month number
year number

How can I go about doing this? I'm very new to data-warehousing and
have never had to this before. Any suggestions, code
snippets...anything is welcome!

Thanks in advance for any help you can provide!

KS.

 
 
 

Code for "bucket-ized" time table???

Post by Hans Forbric » Thu, 20 May 2004 08:43:11



> I am trying to create in my Oracle test database a "time" table that
> would have time buckets. What I mean is that, it would have some
> structure like this

Are you allowed to use Oracle capabilities, or do you need to be 'vendor
neutral'?

If you are allowed to take advantage of Oracle native capabilities,
hopefully you are using Oracle9i R2.  Then look up the NTILE and
WIDTH_BUCKET functions, and the examples, in the Oracle supplied manual

Oracle9i Data Warehousing Guide
Release 2 (9.2)
Part Number A96520-01

available at http://docs.oracle.com ... (table of contensts at
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96520/t...)

Also I highly recommend a gander at 'Mastering Oracle SQL' from
http://oracle.oreilly.com/ as it gives the logic behind those functions -
as well as many many more SQL tricks that your typical developer misses.

/Hans

 
 
 

Code for "bucket-ized" time table???

Post by Joerg Nar » Sun, 23 May 2004 22:33:50




Quote:> I am trying to create in my Oracle test database a "time" table that
> would have time buckets. What I mean is that, it would have some
> structure like this

> 0-5 minute bucket
> 10-15 minute bucket
> 15-20 minute bucket
> ...
> 55-60 minute bucket
> 0-2 hour bucket
> 2-4 hour bucket
> 4-6 hour bucket
> ...
> 22-24 hour bucket
> day number
> week number
> month number
> year number

A vendor neutral approach could be to create an additional bucket dimension
(with a key column in your fact table) if each fact has this dimensionality.
This would allow your users to see how the bucket usage developed over time.

Kind regards,

Joerg

 
 
 

1. : Connect strings - "T:"/"2:"/"X:" ?

despite browsing on-line and hardcopy manuals, I haven't found
an overview of SQL*Net connect strings/protocol specifiers,
like for example

  T: TCP/IP
  2: OS/2, Windows/NT, Windows 3.x
  X: SPX/IPX

can anybody point me to relevant docs (FAQ, Oracle on-line or hardcopy
manuals)?

Thanks,

Malgorzata Roos, University of Zurich

2. What happened with ORBS?

3. Strange question on error message " PLS-00103 : Encountered the symbol "?" "" ( Urgent)

4. IPSEC newbbie

5. "Named Users" vs. "Concurrent Users" Lic.

6. 3/18 Prices Cut on Apple/Mac/Powerbook stuff

7. "Stored Procedures"- versus "SQL*Forms-only"

8. Excel 97 Macro Problem

9. Help - "Production" and "Test" databases

10. Oracle7 "fieldtypes", "random selection" and more

11. Stored procedures and "select" requires "into"...why?

12. SQL*Plus not parsing "create trigger" and "create type" commands