9 Replies Latest reply: Nov 9, 2015 4:12 PM by Frank Chukoskie RSS

    Reload Stalls in Script with Two-Table Join

    Rayna Curtis

      Hoping someone can see what I am doing wrong; I have done this many times before and never had an issue.

       

      I have two tables and I am trying to load two fields from one table into the LOAD statement of the other.  The script reloads fine as long as the two fields are not accessed in the preceding load statement, but the minute that I add them back into the LOAD, the reload stalls right at the very end.

       

      Am I missing something?

       

      To show an example...this loads fine:

       

      LOAD

      "reservation_number"  as "Room Night ResNum",
      "number_of_adults" as "Room Night numAD",
      "number_of_xadult" as "Room Night numXAD",
      "number_of_senior" as "Room Night numSEN",
      "number_of_infant" as "Room Night numINF",
      "number_of_children" as "Room Night numCHI",
      "number_of_youth" as "Room Night numYOU",
      "number_of_other" as "Room Night numOT"//,
      //meal_plan as "Room Night Meal Plan"//,
      //description as "Room Night Rate Type Description"
      ;

      SQL SELECT rr.*, rt.meal_plan, rt.description

      FROM $(TBLPRE)fdresrev rr inner join $(TBLPRE)fdratetype rt on

      rr.property_code = rt.property_code

      and rr.rate_category = rt.rate_category

      and rr.rate_type = rt.rate_type

      where sba_date>=from_date

      and sba_date<=to_date;

       

      But this stalls:

       

      LOAD

      "reservation_number"  as "Room Night ResNum",
      "number_of_adults" as "Room Night numAD",
      "number_of_xadult" as "Room Night numXAD",
      "number_of_senior" as "Room Night numSEN",
      "number_of_infant" as "Room Night numINF",
      "number_of_children" as "Room Night numCHI",
      "number_of_youth" as "Room Night numYOU",
      "number_of_other" as "Room Night numOT",
      meal_plan as "Room Night Meal Plan",
      description as "Room Night Rate Type Description"
      ;

      SQL SELECT rr.*, rt.meal_plan, rt.description

      FROM $(TBLPRE)fdresrev rr inner join $(TBLPRE)fdratetype rt on

      rr.property_code = rt.property_code

      and rr.rate_category = rt.rate_category

      and rr.rate_type = rt.rate_type

      where sba_date>=from_date

      and sba_date<=to_date;

       

      (The meal_plan and description fields are the ones from the other table, obviously.  And I have done this in other views successfully!)

       

      Thanks for any suggestions anyone can offer!