PROMPT Creating view rush_bag_report_v...

CREATE OR REPLACE FORCE VIEW rush_bag_report_v AS
   SELECT f.flight_id,
          f.flight_no,
          f.flight_date,
          fd.dest_order,
          b.bag_destination,
          b.bag_tag,
          b.bag_tag1,
          b.bag_tag2a,
          b.bag_tag2b,
          LTRIM(TO_CHAR(b.bag_tag3, '000000')) bag_tag3,
          b.uld_no,
          SUBSTR (TO_CHAR (b.bag_sequence_no) || '/' ||
                  TO_CHAR (u.uld_no_of_bags), 1, 9)        uld_seq,
          u.uld_hold_no,
          b.worldtracer_ref
   FROM   bag          b,
          pax          p,
          flight       f,
          flight_dests fd,
          ulds         u
   WHERE  b.pax_id                        = p.pax_id
   AND    p.flight_id                     = f.flight_id
   AND    f.flight_id                     = fd.flight_id
   AND    fd.flight_destination           = b.bag_destination
   AND    b.uld_no                        = u.uld_no
   AND    u.flight_id                     = f.flight_id
   AND    b.loaded_status                 = 'Y'
   AND    NVL (b.bag_exception, CHR (2))  = 'RUSH'
   AND    b.delete_marker                != 1
   AND    p.delete_marker                != 1
   AND    b.authority_to_load_dcs         = 'Y';
