4 Replies Latest reply on Mar 21, 2018 11:19 AM by martin.jesterhoudt

    How to join a procedure? (ERROR: TEIID31119 Symbol x.column1 is specified with an unknown group context)

    martin.jesterhoudt

      Hi,

       

      I am trying to join the results of a procedure with another table but keep getting this error: ERROR: TEIID31119 Symbol x.column1 is specified with an unknown group context

       

      This is the transformation code:

       

      SELECT

      1 AS ROW_ID, 'X' AS Periode, y.O1 AS Aantal_OD_Pax_Vertrek

      FROM TabA.Aantal_OD_Pax_Vertrek AS x

      INNER JOIN

           (SELECT x.ROW_ID, y.* FROM (EXEC PIVOT_TEST(x.column1, x.column2, convert(null, string), 'x', 'y', 'z', 'zz')) AS y) AS z

      ON z.ROW_ID = x.ROW_ID

       

      The procedure PIVOT_TEST is working fine.

       

      Can someone please advice or guide me in the right direction? Thanks!


      Martin

      Ps. I also tried with constants:

       

      SELECT

      1 AS ROW_ID, 'X' AS Periode, y.O1 AS Aantal_OD_Pax_Vertrek

      FROM TabA.Aantal_OD_Pax_Vertrek AS x

      INNER JOIN

           (SELECT x.ROW_ID, y.* FROM (EXEC PIVOT_TEST('a', 'b', convert(null, string), 'x', 'y', 'z', 'zz')) AS y) AS z

      ON z.ROW_ID = x.ROW_ID

       

      Error: ERROR: TEIID31119 Symbol x.ROW_ID is specified with an unknown group context