使用oracle-apex 4, 我报告了这些
表格
airplane(plane_id,type,total_seats,starta,enda,startb,endb,startc,endc)
flight_shedule (flight_id,departure_dt,source,destination,arrival_dt)
flight_seating_detail (flight_id,departure_dt,seat_no,class,fare,status)
我将flight_id
列作为flight_shedule
报告中的链接列,当我点击它时,我希望它开始填充值
在flight_seating_detail
报告中根据自己的列。
我有一个代码,但我如何在Oracle APEX中执行此操作?
insert into flight_seating_detail
with
seats as (select rownum r
from dual
connect by level <= 350
)
select
flight_shedule.flight_id,
flight_shedule.departure_date,
r seat,
case
when r between start_a and end_a then 'A'
when r between start_b and end_b then 'B'
when r between start_c and end_c then 'C'
end case
from seats,
airplane,
flight_shedule
where flight_shedule.airplane_id = airplane.airplane_id
and r <= airplane.end_c;