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: Table/view to generate integers from 1 to 500

Re: Table/view to generate integers from 1 to 500

From: DA Morgan <damorgan_at_x.washington.edu>
Date: Sun, 16 Jan 2005 05:20:59 -0800
Message-ID: <41ea6a31$1_2@127.0.0.1>


Edzard wrote:

> Is tehere a suitable table in Oracle catalog to select just integer
> values etween 1 and N, where N is at least 500?
>
> Need this as driving table for a report based on a view, where the
> view calls a stored procedure.
>
> E.G function calc_fuel (in_ship, in_date)
> view daily_fuel_consumption (ship, day, fuel)
> select ship,
> trunc (sysdate) - x.i day,
> calc_fuel (ship, trunc (sysdate) - x.i) fuel
> from ship, x
> where x.i between 1 and 31
>
> It is easy enough to create x as an auxilary table but this requires
> DML in the customer database.
>
> Is there a solution with just views or stored procedure?
>
> Edzard Pasma

SELECT rownum
FROM all_objects
WHERE rownum < 501;

should do it. But I must caution that this has all the makings of a bad design.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace 'x' with 'u' to respond)
Received on Sun Jan 16 2005 - 07:20:59 CST

Original text of this message

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