0 Replies Latest reply on Jul 1, 2013 12:47 AM by neetacomp

    Virtual Procedure to insert data into table is not working

    neetacomp

      I am not able to create insert/update procedure/trigger

       

      I have followed following steps in Teiid Designer

       

      - Created a source model (import)

      - Created "relational view model", then choose to transform a existing model. That will create views for all the tables in that model selected.

       

      Now I am following below steps

       

      - Double click tblItems view (one of the view in view model)

      - Checked the checkbox 'Supports Update'

      - Goto Insert tab

      - Unchecked 'Use Default' checkbox

      - Creating instead of trigger as below

           CREATE TRIGGER ON tblITEMS

           INSTEAD OF INSERT

           AS

           FOR EACH ROW

           BEGIN   

               INSERT INTO SQLServerSourceModel1.tblItems (SQLServerSourceModel1.tblItems.ItemId, SQLServerSourceModel1.tblItems.Part, SQLServerSourceModel1.tblItems.SegCode) VALUES ('Neeta1', 'Part1',      'Seg1');

           END

       

      ==> But when I save, all the contents goes away except first 3 lines.

       

      Can you please tell me what is wrong in above trigger?

       

      Once above trigger works, can I directlt use insert <viewname> to insert data from my virtual procedure? 

       

      Please help to resolve it.

       

      Thanks,

      Neeta