use a second query in itself
How to do this?
First query (command1) must execute first. Second query (command 2) must execute last.
I have a report for same companies. First command (procedure) return sth like this for two companies:
| NUMBER | COMPANY | DAY | MONTH | YEAR | COMPANY | DAY | MONTH | YEAR |
and second command return exactly this:
| NUMBER | COMPANY | DAY | MONTH | YEAR |
Command 1 looks like:
select
a.number,
a.company, a.day, a.month, a.year,
b.company, b.day, b.month, b.year,
from table( REP_PCK.rep(sysdate, 'IBM') ) a
join table( REP_PCK.rep(sysdate, 'SONY') ) b
on (a.number = b.number)
Command 2 looks like:
select number, 'SUM FOR ALL' company, day, month, year
from rap_gtt
I can not do this like this:
select
a.number,
a.company, a.day, a.month, a.year,
b.company, b.day, b.month, b.year,
c.company, c.day, c.month, c.year,
from table( REP_PCK.rep(sysdate, 'IBM') ) a
join table( REP_PCK.rep(sysdate, 'SONY') ) b on (a.number = b.number)
join rap_gtt c on (a.number = c.number)
cause I will get no data or data that was in rap_gtt before I execute query.
Ok, I can use two queries but how to set that command 1 should execute first, command 2 has to wait for command 1 and after this just execute.
Edited by rozpalacz - 19 Jan 2011 at 9:09pm