2 Replies Latest reply: Mar 19, 2012 7:07 AM by Przemysław Wojda RSS

    0 lines fetched

    Przemysław Wojda

      Hi All,

       

      when reloading the below script last three lines, meant to create seperate tables for different AccTypes, get 0 lines. Why?

       

      DBS:
      SELECT DB_Name FROM Configuration
      
      AccountType:
      LET NumberOfDBS = NoOfRows('DBS');
      FOR i=0 TO $(NumberOfDBS)-1
      LET DB_Name = Peek('DB_Name', $(i), 'DBS');
      SELECT
      '$(DB_Name)' AS DB_Name, 
      CASE WHEN Com_Value = 1 THEN 'ER' WHEN Com_Value = 2 THEN 'KP' WHEN Com_Value = 3 THEN 'KH' END AS AccType
      FROM CDN_$(DB_Name).CDN.Company;
      NEXT
      
      DBS_ER: NoConcatenate LOAD DB_Name, AccType Resident AccountType Where AccType = 1;
      DBS_KP: NoConcatenate LOAD DB_Name, AccType Resident AccountType Where AccType = 2;
      DBS_KH: NoConcatenate LOAD DB_Name, AccType Resident AccountType Where AccType = 3;
      

       

      Regards,

      Przemek