Back to OIM Explorer

dbo.QER_PITShopBoardPrepareDelete

Stored ProcedureSQL_STORED_PROCEDURESandbox DB

Stored Procedure.

Source: sandbox-db sys.sql_modules

Source size: 1.356 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_FGISessionContext source text reference
  • references source dbo.QBM_FGISessionErrorRethrow source text reference
  • references source dbo.QBM_PExecuteSQLMulti source text reference
  • references source dbo.QBM_PSessionErrorAdd source text reference
  • references source dbo.QER_ZITShopProductNodeCheck source text reference

Complete Source

SQL69 lines
1CREATE PROCEDURE QER_PITShopBoardPrepareDelete(2  @uid_org varchar(38)3)4AS5BEGIN6  DECLARE @GenProcID varchar(38) = dbo.QBM_FGISessionContext('')7  DECLARE @ElementBuffer QBM_YCursorBuffer8  DECLARE @XUser nvarchar(64) = object_name(@@procid)9  DECLARE @Xdate datetime = getutcdate()10  SET XACT_ABORT OFF11  BEGIN TRY12    UPDATE PersonInBaseTree13    SET XOrigin = 0,14    XDateUpdated = @Xdate,15    XUserUpdated = @XUser16    WHERE17      UID_Org = @uid_org18    DELETE PersonInBaseTree19    WHERE20      uid_org = @uid_org21    UPDATE PersonInBaseTree22    SET XOrigin = 023    WHERE24      UID_Org IN(25    SELECT uid_org26    FROM BaseTree27    WHERE28      uid_parentorg = @uid_org)29    DELETE PersonInBaseTree30    WHERE31      uid_org IN(32    SELECT uid_org33    FROM BaseTree34    WHERE35      uid_parentorg = @uid_org)36    INSERT INTO @ElementBuffer(ContentFull)37    SELECT38      CONCAT('39		delete ',40      t.TableName,41      ' where uid_org = ''',42      @uid_org,43      '''')44    FROM BaseTreeAssign a45    JOIN DialogTable t46      WITH(readpast)47      ON a.UID_DialogTableMN = t.UID_DialogTable48    JOIN DialogTable prod49      WITH(readpast)50      ON a.UID_DialogTableElement = prod.UID_DialogTable51    WHERE52      a.IsITShopEnabled = 153    EXEC QBM_PExecuteSQLMulti @ElementBuffer,54    0,55      @@PROCID56    EXEC QER_ZITShopProductNodeCheck 0,57      @uid_org,58    NULL,59      @genprocID60  END TRY61  BEGIN CATCH62    EXEC QBM_PSessionErrorAdd DEFAULT63    DECLARE @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow()64    RAISERROR(@Rethrow,65    18,66    1)67      WITH NOWAIT68  END CATCH69END
Open raw exported source
SQL ยท Raw11 lines
1     create   procedure QER_PITShopBoardPrepareDelete (@uid_org varchar(38) ) as begin declare @GenProcID varchar(38) = dbo.QBM_FGISessionContext2('') declare @ElementBuffer QBM_YCursorBuffer declare @XUser nvarchar(64) = object_name(@@procid) declare @Xdate datetime = getutcdate() SET XACT_ABORT3 OFF BEGIN TRY   update PersonInBaseTree set XOrigin = 0  , XDateUpdated = @Xdate , XUserUpdated = @XUser where UID_Org = @uid_org delete PersonInBaseTree4 where uid_org = @uid_org update PersonInBaseTree set XOrigin = 0 where UID_Org in (select uid_org from BaseTree where uid_parentorg = @uid_org) delete5 PersonInBaseTree where uid_org in (select uid_org from BaseTree where uid_parentorg = @uid_org)  insert into @ElementBuffer (ContentFull) select concat6('7		delete ' , t.TableName , ' where uid_org = ''' , @uid_org , '''' ) from BaseTreeAssign a join DialogTable t with (readpast) on a.UID_DialogTableMN8 = t.UID_DialogTable join DialogTable prod with (readpast) on a.UID_DialogTableElement = prod.UID_DialogTable    where a.IsITShopEnabled = 1 exec QBM_PExecuteSQLMulti9 @ElementBuffer, 0, @@PROCID  exec QER_ZITShopProductNodeCheck 0, @uid_org, null, @genprocID END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default declare10 @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH end 11