3 Replies Latest reply on Mar 14, 2013 3:29 PM by rareddy

    Teiid Designer

    jane_lj

      Hi,

       

      I created a transformation mapping between VDB1 to VDB2 which have been deployed into Teiid. And I have seen the SELECT sql which is generated by Designer. In the transformation, there is one attribute which uses CONVERT function to convert the type from Double (VDB1) to Float(VDB2) type.

       

      When I read, it acutally call SELECT sql, which runs well.

      But I write (INSERT), the default generated UPDATE sql don't know how to do for that attribute, so failed.  I got this error:

       

      Error: TEIID30492 Remote org.teiid.api.exception.query.QueryValidatorException: TEIID30492 TEIID30376 The specified change set [uwi, well_name, x_coordinate, y_coordinate, elev_type, elevation, elevation_ouom] against an inherently updatable view does not map to a key preserving group.

      SQLState:  TEIID30492

      ErrorCode: 0

       

      So where and how to tell Designer, for writing, should do the CONVERT from Float to Double?

       

      Thanks.

        • 1. Re: Teiid Designer
          rareddy

          In Designer, where you saw the transformation for "select", there are additional tabs for "insert", "update" and "delete". Use that area to define your transformation that converts the data to right format.

          • 2. Re: Teiid Designer
            jane_lj

            Ramesh, I saw those tabs, but since we have lots of attributes mapped, is there anyway we don't need to write INSERT sql from scratch, because most of attributes mapping can refer to SELECT mapping, only one or two need specail treatment.

             

            Also, if I write, how to write the INSERT sql which can be generic enough to take care of all case of INSERT, such as all columns insert, partial columns insert with different combination.

            Do you have any examples I can learn?

             

            Thanks.

            • 3. Re: Teiid Designer
              rareddy