Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Getting NON-existing data
HI,
I had a similar problem last year.
I called it reporting on things that
don't exist. The report HAD to be
written that way because the old
COBOL flat file system was written
that way. Which sort of defeated the
whole idea of moving forward with
new technology.
You could create a virtual table with:
select 1 ID
from DUAL
UNION
select 2 ID
from dual
...
To use:
Select a.something, b.ID
from table1 a,
(select 1 ID from DUAL UNION select 2 ID from dual ...) b
Beware. ON Oracle 7.3.2 this will work in SQLPLUS. But it won't work in PLSQL. Supposedly, it will work with version 7.3.4 and above.
So, I eventually had to hardcode a FOR loop into my ProC program.
Rodger
In article <376F4EEE.1383_at_nob.nl>,
Niek Kerkemeijer <Niek.Kerkemeijer_at_nob.nl> wrote:
> Hi,
>
> I have a nice question:
> I need oracle to generate a number-range for me without having
> a table containing these values.
>
> Example:
> I have an empty database (there are no tables in it) and I need
> a query which results in the following:
>
> +------+
> | id |
> +------+
> | 1 |
> | 2 |
> | 3 |
> | 4 |
> | 5 |
> | 6 |
> | 7 |
> | 8 |
> | 9 |
> | 10 |
> +------+
>
> Any ideas?
>
> Niek.
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Received on Fri Jun 25 1999 - 13:37:16 CDT