dbo.QER_ZITShopMakeDecisionCD

SQL_STORED_PROCEDURE

Created 2025-06-27T18:01:06.137 · modified 2026-04-14T23:20:38.617 · source: live DB sys.objects/sys.sql_expression_dependencies.

Open formatted source/search result

Parameters

NameTypeOutput
@SlotNumberintno

Referenced objects

SchemaObjectColumn/minorClass
personwantsorgOBJECT_OR_COLUMN
PWOHelperPWOOBJECT_OR_COLUMN
QBM_PJobCreate_HOCallMethodOBJECT_OR_COLUMN
QBM_PSessionErrorAddOBJECT_OR_COLUMN
QBM_YCursorBufferTYPE
QBM_YDBQueueCurrentTYPE
QBMDBQueueCurrentOBJECT_OR_COLUMN
QERWorkingStepOBJECT_OR_COLUMN
dboQBM_FCVStringToBitOBJECT_OR_COLUMN
dboQBM_FGIConfigparmValueOBJECT_OR_COLUMN
dboQER_FGIGenProcIDForPWOOBJECT_OR_COLUMN

Source excerpt

First extracted SQL definition lines from the exported source. Use the full source page for complete context.

Open full formatted source

1   create   procedure QER_ZITShopMakeDecisionCD (@SlotNumber int) as begin declare @UID_Personwantsorg varchar(38) declare @GenProcID varchar(38
2) declare @Decision nvarchar(16) declare @CfgUseGenProcID bit = dbo.QBM_FCVStringToBit(dbo.QBM_FGIConfigparmValue('Common\ProcessState\UseGenProcIDFromPWO'
3)) declare @Reason nvarchar(255) declare @uid_person varchar(38) declare @cond nvarchar(max) declare @whereclause nvarchar(max) declare @SQLcmd nvarchar
4(max) declare @muster nvarchar(max) declare @BasisObjectKey varchar(138) declare @CountOfRows int declare @DecisionLevel int declare @ElementBuffer QBM_YCursorBuffer
5 declare @ElementCount int declare @ElementIndex int declare @DBQueueCurrent QBM_YDBQueueCurrent SET XACT_ABORT OFF BEGIN TRY insert into @DBQueueCurrent
6(UID_DialogDBQueue, UID_Parameter, UID_SubParameter, GenProcID) select UID_DialogDBQueue, UID_Parameter, UID_SubParameter, GenProcID from QBMDBQueueCurrent
7 cu with (readpast) where cu.SlotNumber = @SlotNumber if @@rowcount = 0 begin goto EndLabel end select @muster = N'
8if exists (select top 1 1
9			 from Personwantsorg
10				where (
11-- die Kundenklausel
12@whereclause
13						)
14				and uid_personwantsorg = ''@uid_personwantsorg''
15			)
16 begin
17	select 1
18 end
19'
20 declare @AutomaticReasonTrue nvarchar(128) declare @AutomaticReasonFalse nvarchar(128) insert into @ElementBuffer (UID1  , UID2  , ContentFull  , LongIdent1
21  , LongIdent2  , ObjectKey1  , Int1  ) select pwo.uid_personwantsorg , dbo.QER_FGIGenProcIDForPWO(pwo.GenProcID, p.GenProcID, @CfgUseGenProcID) as GenProcID
22 , isnull(ds.WhereClause, N'') , isnull(ds.AutomaticReasonTrue, ''), isnull(ds.AutomaticReasonFalse, ''), pwo.XObjectKey , pwo.DecisionLevel from @DBQueueCurrent
23 p join personwantsorg pwo on p.uid_parameter = pwo.uid_personwantsorg join PWOHelperPWO ph on pwo.uid_personwantsorg = ph.uid_personwantsorg and pwo.decisionlevel
24 = ph.levelnumber join QERWorkingStep ds on ph.UID_QERWorkingStep = ds.UID_QERWorkingStep  where ph.UID_PWODecisionRule = 'QER-PWODecisionRule-CD'   and
25 OrderState in ('OrderProduct', 'OrderProlongate', 'OrderUnsubscribe') select @ElementCount = @@ROWCOUNT select @ElementIndex = 1 while @ElementIndex <=
26 @ElementCount begin select top 1 @uid_personwantsorg = bu.UID1  , @GenProcID = bu.UID2  , @whereclause = bu.ContentFull  , @AutomaticReasonTrue = bu.LongIdent1
27  , @AutomaticReasonFalse = bu.LongIdent2  , @BasisObjectKey = bu.ObjectKey1  , @DecisionLevel = Int1  from @ElementBuffer bu where bu.ElementIndex = @ElementIndex
28 select @SQLcmd = @muster select @SQLcmd = replace(@SQLcmd , N'@whereclause', @whereclause) select @SQLcmd = replace(@SQLcmd, N'@uid_personwantsorg', @uid_personwantsorg
29)  BEGIN TRY exec sp_executesql @SQLcmd select @CountOfRows = @@Rowcount END TRY BEGIN CATCH select @CountOfRows = -1 END CATCH if @CountOfRows > 0 begin
30  select @decision = 'True'  if @AutomaticReasonTrue > ' ' begin select @Reason = @AutomaticReasonTrue end else begin select @reason = '#LDS#Automatic system approval with method CD : Condition was met.|'
31 end end if @CountOfRows = 0  begin select @decision = 'False'  if @AutomaticReasonFalse > ' ' begin select @Reason = @AutomaticReasonFalse end else begin
32 select @reason = '#LDS#Automatic system approval with method CD : Condition was not met.|' end end if @CountOfRows < 0  begin select @decision = 'False'
33 select @reason = '#LDS#Automatic system approval: Condition caused runtime error using method CD.|' end  select @cond = 'uid_personwantsorg = ''' + rtrim
34(@uid_personwantsorg) + ''' and DecisionLevel = ' + STR(@DecisionLevel)  exec QBM_PJobCreate_HOCallMethod @objecttype = 'personwantsorg' , @whereclause
35 = @cond , @save = 1 , @MethodName = 'MakeDecision' , @GenProcID = @GenprocID , @ObjectKeysAffected = DEFAULT , @param1 = 'sa' , @param2 = @decision , 
36@param3 = @reason , @Retries = 3 , @isToFreezeOnError = 1  , @BasisObjectKey = @BasisObjectKey , @checkForExisting = 1  , @WhereClauseAdditional = ' OrderState in(''OrderProduct'', ''OrderProlongate'', ''OrderUnsubscribe'')'
37  select @ElementIndex += 1 end  END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default, @SQLcmd RAISERROR ('', 18, 1) WITH NOWAIT END CATCH endLabel: return
38 end 
39

Module relation graph

Loading module relation graph…

Source-derived context

Generated from exported SQL module definitions plus read-only sandbox sys.objects/sys.parameters/sys.sql_expression_dependencies metadata. This is factual source evidence, not a semantic guess.

provenance: SQL definition export provenance: sandbox DB metadata modified: 2026-04-14T23:20:38.617

creates object-layer jobs via QBM_PJobCreate* calls object-layer method via HOCallMethod has TRY/CATCH error handling

Summary: calls QBM_PJobCreate_HOCallMethod, QBM_PSessionErrorAdd; writes INSERT into; reads/joins QBMDBQueueCurrent, Personwantsorg, personwantsorg, PWOHelperPWO, QERWorkingStep; uses config Common\ProcessState\UseGenProcIDFromPWO

Declared parameters

ParameterTypeDirection
@SlotNumberintinput

DML targets

INSERT into

Config/session

Config: Common\ProcessState\UseGenProcIDFromPWO

Session: None extracted.

DBQueue/tasks

None extracted.

Temp tables / referenced variables

Temp: #LDS #Automatic

Variables: @SlotNumber @UID_Personwantsorg @GenProcID @Decision @CfgUseGenProcID @Reason @uid_person @cond @whereclause @SQLcmd @muster @BasisObjectKey @CountOfRows @DecisionLevel @ElementBuffer @ElementCount @ElementIndex @DBQueueCurrent @rowcount @uid_personwantsorg @AutomaticReasonTrue @AutomaticReasonFalse @ROWCOUNT @Rowcount @decision @reason @objecttype @save @MethodName @GenprocID @ObjectKeysAffected @param1 @param2 @param3 @Retries @isToFreezeOnError @checkForExisting @WhereClauseAdditional

Referenced by / reverse dependencies

Generated from live DB metadata, FK rows, and exported SQL dependency/source extraction. This is factual linkage evidence, not inferred behavior.

No reverse dependencies extracted.