Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Table/view to generate integers from 1 to 500
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