Back to OIM Explorer

dbo.QER_PQEREntitlementSourceDef

Stored ProcedureSQL_STORED_PROCEDURESandbox DB

Stored Procedure.

Source: sandbox-db sys.sql_modules

Source size: 1.767 characters

Interpretation

  • Database routine. Review parameters, called procedures, DBQueue inserts, and QBM_PJobCreate helper calls before assuming side effects.

Relations

  • No extracted relations.

Typed Edges

  • references source dbo.QBM_FCVElementToObjectKey1 source text reference
  • references source dbo.QBM_FCVGuidToTransfer source text reference
  • references source dbo.QBM_FGISessionErrorRethrow source text reference
  • references source dbo.QBM_PSessionErrorAdd source text reference

Complete Source

SQL78 lines
1CREATE PROCEDURE QER_PQEREntitlementSourceDef(2  @ModuleName varchar(3),3  @TableName varchar(30),4  @GUID_Extern varchar(38),5  @Ident_QEREntitlementSource nvarchar(64),6  @SQLQuery nvarchar(max)7)8AS9BEGIN10  DECLARE @uid_dialogtable varchar(38)11  DECLARE @UID_QEREntitlementSource varchar(38)12  SET XACT_ABORT OFF13  BEGIN TRY14    SELECT @uid_dialogtable = NULL15    SELECT TOP 1 @uid_dialogtable = t.UID_DialogTable16    FROM DialogTable t17    WHERE18      t.TableName = @TableName19    IF @uid_dialogtable IS NULL20    BEGIN21      RAISERROR('#LDS#TableNotFound|',22      18,23      1)24        WITH nowait25    END26    SELECT27      @UID_QEREntitlementSource = dbo.QBM_FCVGuidToTransfer(@GUID_Extern,28      @Modulename)29    IF NOT EXISTS(30      SELECT TOP 1 131      FROM QEREntitlementSource es32      WHERE33        es.UID_QEREntitlementSource = @UID_QEREntitlementSource)34    BEGIN35      INSERT INTO QEREntitlementSource(UID_QEREntitlementSource,36      UID_DialogTable,37      Ident_QEREntitlementSource,38      SQLQuery,39      XDateInserted,40      XDateUpdated,41      XUserInserted,42      XUserUpdated,43      XObjectKey)44      SELECT45        @UID_QEREntitlementSource,46        @uid_dialogtable,47        @Ident_QEREntitlementSource,48        @SQLQuery,49        GETUTCDATE(),50        GETUTCDATE(),51        OBJECT_NAME(@@procid),52        OBJECT_NAME(@@procid),53        dbo.QBM_FCVElementToObjectKey1('QEREntitlementSource',54        'UID_QEREntitlementSource',55        @UID_QEREntitlementSource)56    END57    ELSE58    BEGIN59      UPDATE QEREntitlementSource60      SET Ident_QEREntitlementSource = @Ident_QEREntitlementSource,61      SQLQuery = @SQLQuery,62      xdateupdated = GETUTCDATE()63      WHERE64        UID_QEREntitlementSource = @UID_QEREntitlementSource AND(ISNULL(Ident_QEREntitlementSource, '') <> @Ident_QEREntitlementSource OR ISNULL65      (sqlquery, '') <> @SQLQuery)66    END67  END TRY68  BEGIN CATCH69    EXEC QBM_PSessionErrorAdd DEFAULT70    DECLARE @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow()71    RAISERROR(@Rethrow,72    18,73    1)74      WITH NOWAIT75  END CATCH76  ende:77  RETURN78END
Open raw exported source
SQL ยท Raw12 lines
1  create   procedure QER_PQEREntitlementSourceDef ( @ModuleName varchar(3) , @TableName varchar(30) , @GUID_Extern varchar(38) , @Ident_QEREntitlementSource2 nvarchar(64) , @SQLQuery nvarchar(max) ) as begin declare @uid_dialogtable varchar(38) declare @UID_QEREntitlementSource varchar(38) SET XACT_ABORT OFF3 BEGIN TRY select @uid_dialogtable = null select top 1 @uid_dialogtable = t.UID_DialogTable from DialogTable t where t.TableName = @TableName if @uid_dialogtable4 is null begin raiserror ('#LDS#TableNotFound|', 18, 1) with nowait end select @UID_QEREntitlementSource = dbo.QBM_FCVGuidToTransfer(@GUID_Extern, @Modulename5) if not exists (select top 1 1 from QEREntitlementSource es where es.UID_QEREntitlementSource = @UID_QEREntitlementSource ) begin insert into QEREntitlementSource6 (UID_QEREntitlementSource, UID_DialogTable, Ident_QEREntitlementSource, SQLQuery , XDateInserted, XDateUpdated, XUserInserted, XUserUpdated , XObjectKey7 ) select @UID_QEREntitlementSource, @uid_dialogtable, @Ident_QEREntitlementSource, @SQLQuery , GETUTCDATE(), GETUTCDATE(), OBJECT_NAME(@@procid), OBJECT_NAME8(@@procid) , dbo.QBM_FCVElementToObjectKey1('QEREntitlementSource', 'UID_QEREntitlementSource', @UID_QEREntitlementSource) end else begin update QEREntitlementSource9 set Ident_QEREntitlementSource = @Ident_QEREntitlementSource , SQLQuery = @SQLQuery , xdateupdated = GETUTCDATE() where UID_QEREntitlementSource = @UID_QEREntitlementSource10 and (ISNULL(Ident_QEREntitlementSource, '') <> @Ident_QEREntitlementSource or ISNULL(sqlquery, '') <> @SQLQuery ) end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd11 default declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH ende: return end 12