13 Replies Latest reply on Jul 15, 2016 8:56 AM by Steven Hawkins

    Teiid 9.0.0 - afterLoadScript giving exception in loadMatView

    Mark Tawk Novice

      I'm migrating from Teiid 8.11.3 to 9.0.0

       

      I have changed the version column from integer to string in the materialization status table.

       

      Actually i'm getting an exception in the procedure loadMatView on afterLoadScript execution for the view external materialization

      I did not find in teiid log file where the exception is written via EXECUTE logMsg(context=>'org.teiid.MATVIEWS', level=>'WARN', msg=>e.exception);

      I'm always getting FAILED_LOAD in the status table.

       

      Here is a script of a simple external view:

       

      CREATE VIEW "User" OPTIONS ( MATERIALIZED 'TRUE', UPDATABLE 'TRUE', "teiid_rel:MATVIEW_TTL" 0 , MATERIALIZED_TABLE 'implify_dataModel.implify_data.User', "teiid_rel:MATERIALIZED_STAGE_TABLE" 'implify_dataModel.implify_data.User_stage', "teiid_rel:ALLOW_MATVIEW_MANAGEMENT" 'true', "teiid_rel:MATVIEW_STATUS_TABLE" '"imTeiidStatus"', "teiid_rel:MATVIEW_SHARE_SCOPE" 'VDB', "teiid_rel:MATVIEW_ONERROR_ACTION" 'IGNORE' , "teiid_rel:MATVIEW_BEFORE_LOAD_SCRIPT" 'execute implify_dataModel.native(''truncate table "implify_data"."User_stage"'');' ,"teiid_rel:MATVIEW_AFTER_LOAD_SCRIPT" 'execute  implify_dataModel.native(''ALTER TABLE "implify_data"."User" RENAME TO "implify_data"."User_temp"'');execute  implify_dataModel.native(''ALTER TABLE "implify_data"."User_stage" RENAME TO "implify_data"."User"'');execute  implify_dataModel.native(''ALTER TABLE "implify_data"."User_temp" RENAME TO "implify_data"."User_stage"'');execute implify_dataModel.native(''truncate table "implify_data"."User_stage"''); SELECT ON_VIEW_LOADED_COMPLETE(''VIEW.B7F553FA-4F52-45FE-82BD-E2C18A4658B2.User'')  ' , "teiid_rel:ON_VDB_DROP_SCRIPT" 'DELETE FROM "imTeiidStatus" WHERE "Name"=''User'' AND "SchemaName" = ''implifyBusinessModel''' ) AS select "imUser"."FirstName" as "imUser_FirstName","imUser"."LastName" as "imUser_LastName" from  "~/h2db/implifyModel"."implify"."imUser" "imUser"