如何在oracle apex中链接两个报告?

时间:2015-12-15 09:28:17

标签: oracle plsql sql-insert oracle-apex

使用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;

0 个答案:

没有答案