6 Replies Latest reply: Feb 2, 2012 8:01 AM by Przemysław Wojda RSS

    How to select data upon a dimension not available in the dataset?

    Przemysław Wojda

      Hi All,

       

      there's a configurational database that stores all database names that I need to select. All these databases have identical structure. Within these databases there's a table (Settings) with a dim (Dimension) upon which I need to decide whether I will select or not table Data within these databases. The table Settings doesn't have any dimension to join it with table Data. Please see the below code and suggest what should I do to select only the dbs where Dimension  = 1.

       

      Table_1:

      SELECT DB_Name FROM DB_Conf;

       

      Table_2:

      LET A = NoOfRows('Table_1');

      FOR i=0 TO $(A)-1

      LET B = peek('DB_Name',$(i),'DZ_Bazy');

      LET C = peek('DB_Name',$(i),'DZ_Bazy')&'.CDN.Settings';

      SELECT

      '$(B)' AS DB_Name,

      Dimension

      FROM $(C);

      NEXT

       

      Table_3:

      LET A = NoOfRows('Table_1');

      FOR i=0 TO $(A)-1

      LET B = peek('DB_Name',$(i),'DZ_Bazy');

      LET C = peek('DB_Name',$(i),'DZ_Bazy')&'.CDN.Data';

      SELECT

      '$(B)' AS DB_Name,

      *

      FROM $(C);

      NEXT

       

       

      Thanks,

      Przemek