4 Replies Latest reply on Apr 4, 2013 6:02 PM by jane_lj

    FOR EACH ROW procedure for INSERT

    jane_lj

      Hi,

       

      I wrote this procedure for INSERT in Teiid Designer, when I save, no errors, everything looks fine.

       

      FOR EACH ROW

      BEGIN ATOMIC

                DECLARE double VARIABLES.elevation;

                DECLARE double VARIABLES.xSurfaceCoordinate;

                DECLARE double VARIABLES.ySurfaceCoordinate;

                SELECT Petrel_SM.PetrelBorehole.WorkingReferenceLevelOffset AS elevation, WellHeadX AS xSurfaceCoordinate, WellHeadY AS ySurfaceCoordinate FROM PetrelBorehole WHERE Petrel_SM.PetrelBorehole.UWI = "NEW".uwi;

                INSERT INTO Petrel_SM.PetrelBoreholeTrajectory (Petrel_SM.PetrelBoreholeTrajectory.UWI, TrajectoryZList, MDList, TrajectoryXList, TrajectoryYList, TrajectoryZUnit, MDUnit, TrajectoryXYUnit, IsSelected) VALUES ("NEW".uwi, computeAbsoluteZ_FloatInDoubleOut("NEW".z, VARIABLES.elevation), "NEW".md, computeTrajectoryXYList_FloatInDoubleOut("NEW".x_off, xSurfaceCoordinate), computeTrajectoryXYList_FloatInDoubleOut("NEW".y_off, ySurfaceCoordinate), "NEW".z_uom, "NEW".md_uom, "NEW".x_off_uom, "NEW".is_selected);

      END

       

       

      But when I run a INSERT statemet against Veiw Model, nothing got inserted, and Teiid didn't throw any errors, exceptions. And Teiid didn't push down the insert request to my real data source.

      Looks like Teiid didn't do anything.

       

      Can you anything wrong in my INSERT procedure?

       

      Thanks.