dbo.QER_PITShopProductNodeMove

SQL_STORED_PROCEDURE

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

Open formatted source/search result

Parameters

NameTypeOutput
@uid_OrgPR_Oldvarcharno
@uid_orgBO_newvarcharno

Referenced objects

SchemaObjectColumn/minorClass
BaseTreeOBJECT_OR_COLUMN
BaseTreeAssignOBJECT_OR_COLUMN
BaseTreeHasObjectOBJECT_OR_COLUMN
DialogTableOBJECT_OR_COLUMN
OrgRootAssignOBJECT_OR_COLUMN
PersonWantsOrgOBJECT_OR_COLUMN
QBM_PExecuteSQLWithRetry_LLPOBJECT_OR_COLUMN
QBM_PJournalOBJECT_OR_COLUMN
QBM_PSessionErrorAddOBJECT_OR_COLUMN
QBM_VQBMRelationOBJECT_OR_COLUMN
QBM_YCursorBufferTYPE
QBM_YParameterListTYPE
QER_PITShopOrderMove_bulkOBJECT_OR_COLUMN
QER_PITShopProductNodeCreateOBJECT_OR_COLUMN
QER_VPWOOrderStateOBJECT_OR_COLUMN
dboQBM_FCVBinaryToStringOBJECT_OR_COLUMN
dboQBM_FCVDatetimeToStringOBJECT_OR_COLUMN
dboQBM_FCVElementToObjectKey2OBJECT_OR_COLUMN
dboQBM_FCVObjectkeyToElementOBJECT_OR_COLUMN
dboQBM_FCVStringToGUIDMAllOBJECT_OR_COLUMN
dboQBM_FGIPrimaryKeyName_FOBJECT_OR_COLUMN
dboQBM_FGISessionContextOBJECT_OR_COLUMN
dboQBM_FGISessionErrorRethrowOBJECT_OR_COLUMN
dboQBM_FGITableNameOBJECT_OR_COLUMN
dboQER_FGIBitPatternInheritInfoOBJECT_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_PITShopProductNodeMove ( @uid_OrgPR_Old varchar(38)  , @uid_orgBO_new varchar(38)  ) as begin declare @uid_OrgPR_New 
2varchar(38) declare @uid_OrgSH_New varchar(38) declare @uid_OrgCU_New varchar(38) declare @uid_orgBO_Old varchar(38) declare @uid_orgSH_Old varchar(38)
3 declare @uid_orgCU_Old varchar(38) declare @Ident_OrgBO_New nvarchar(256) declare @Ident_OrgSH_New nvarchar(256) declare @ObjectKeyElement varchar(138
4)  declare @UID_AccProduct varchar(38) declare @SQLCmdDelete nvarchar(max) declare @SQLCmdInsert nvarchar(max)  declare @UID_BaseTreeHasObject varchar(38
5) declare @SQLCmdBaetreeHasObject nvarchar(max) declare @uid_personwantsorg varchar(38) declare @BasisObjectKey varchar(138) declare @TargetTable varchar
6(30) declare @TargetView varchar(30)  declare @uid_DialogTableAssigned varchar(38) declare @pkname varchar(30) declare @DebugSwitch int = 0 declare @DebugLevel
7 char(1) = 'W' declare @DebugMessage nvarchar(2000) declare @StringQERFGIBitPatternInheritInfo_Direct nvarchar(100) declare @GenProcID varchar(38) declare
8 @ElementBuffer QBM_YCursorBuffer declare @ElementCount int declare @ElementIndex int declare @PWOsToMove QBM_YParameterList    declare @QER_BitPatternInherit_Direct
9 int = dbo.QER_FGIBitPatternInheritInfo('|Direct|', 0)  SET XACT_ABORT OFF BEGIN TRY select @GenProcID = dbo.QBM_FGISessionContext('') select @StringQERFGIBitPatternInheritInfo_Direct
10 = dbo.QBM_FCVBinaryToString(convert(varbinary, dbo.QER_FGIBitPatternInheritInfo('|Direct|', 0)), 0)  select @uid_orgBO_Old = null select @uid_orgSH_Old
11 = null select @uid_orgCU_Old = null select top 1 @uid_orgBO_Old = bo.uid_org, @uid_orgSH_Old = sh.uid_org, @uid_orgCU_Old = cu.uid_org , @Ident_OrgBO_New
12 = bo.Ident_Org , @Ident_OrgSH_New = sh.Ident_Org , @UID_AccProduct = pr.UID_AccProduct from BaseTree pr join BaseTree bo on pr.uid_parentorg = bo.uid_org
13 join BaseTree sh on bo.uid_parentorg = sh.uid_org join BaseTree cu on cu.uid_parentorg = sh.uid_org and cu.itShopInfo = 'CU' where pr.uid_org = @uid_OrgPR_Old
14 and pr.uid_OrgRoot = 'QER-V-ITShopOrg' if @uid_orgBO_Old is null begin  raiserror( '#LDS#The shelf can not be found for the product node.|', 18, 2) with
15 nowait end if @uid_orgSH_Old is null begin  raiserror( '#LDS#The shop cannot be found for the product node.|', 18, 2) with nowait end if @uid_orgCU_Old
16 is null begin  raiserror( '#LDS#The customer node cannot be found for the product node.|', 18, 2) with nowait end if not exists (select top 1 1 from BaseTree
17 where uid_OrgRoot = 'QER-V-ITShopOrg' and ITShopInfo = 'BO' and uid_Org = @uid_orgBO_new ) begin  raiserror( '#LDS#The given target node is not a shelf in IT Shop.|'
18, 18, 2) with nowait end if @uid_orgBO_Old = @uid_orgBO_New begin  goto ende end select @ObjectKeyElement = null  select top 1 @ObjectKeyElement = bho.ObjectKey
19 from BaseTreeHasObject bho where bho.UID_Org = @uid_OrgPR_Old  and InheritInfo = @QER_BitPatternInherit_Direct if @Debugswitch > 0 begin select @DebugMessage
20 = '@ObjectKeyElement  '+ ISNULL(@ObjectKeyElement, '<null>') exec QBM_PJournal @debugmessage, @@procid, 'D', @DebugLevel end  select top 1 @TargetTable
21 = tmn.TableName from BaseTreeAssign ba join DialogTable tb with (readpast) on ba.UID_DialogTableElement = tb.UID_DialogTable join DialogTable tmn with
22 (readpast) on ba.UID_DialogTableMN = tmn.UID_DialogTable  where @ObjectKeyElement like concat('<Key><T>' , tb.TableName , '</T>%') if @Debugswitch > 0
23 begin select @DebugMessage = '@TargetTable  '+ ISNULL(@TargetTable, '<null>') exec QBM_PJournal @debugmessage, @@procid, 'D', @DebugLevel end select top
24 1 @pkname = dbo.QBM_FGIPrimaryKeyName_F(@TargetTable,1) if @pkname = 'uid_org' begin select top 1 @pkname = dbo.QBM_FGIPrimaryKeyName_F(@TargetTable,2
25) end if @DebugSwitch > 0 begin select @DebugMessage = '@pkname  '+ ISNULL(@pkname, '<null>') exec QBM_PJournal @debugmessage, @@procid, 'D', @DebugLevel
26 end  select @SQLCmdDelete = 'update ' + @TargetTable + '
27				set XOrigin = 0
28			where uid_Org = ''' + @uid_OrgBO_Old + '''
29			 and ' + @pkname + '  = '''
30 + dbo.QBM_FCVObjectkeyToElement('ColumnValue1', @ObjectKeyElement) + '''
31
32			delete ' + @TargetTable + '
33			where uid_Org = ''' + @uid_OrgBO_Old + 
34'''
35			 and ' + @pkname + '  = ''' + dbo.QBM_FCVObjectkeyToElement('ColumnValue1', @ObjectKeyElement) + ''''    if @Debugswitch > 0 begin select @DebugMessage
36 = '@SQLCmdDelete  '+ ISNULL(@SQLCmdDelete, '<null>') exec QBM_PJournal @debugmessage, @@procid, 'D', @DebugLevel end if @ObjectKeyElement is null begin
37  raiserror( '#LDS#The product could not be found for the given product node.|', 18, 2) with nowait end if @uid_accProduct is Null begin  raiserror( '#LDS#Associate Accproduct could not be found.|'
38, 18, 2) with nowait end  select top 1 @TargetView = v.TableName from OrgRootAssign oa join BaseTreeAssign ba on oa.UID_BaseTreeAssign = ba.UID_BaseTreeAssign
39 join DialogTable v with (readpast) on v.UID_DialogTableBase = ba.UID_DialogTableMN join QBM_VQBMRelation r on r.UID_DialogTableParent = 'QER-T-ITShopOrg'
40 and r.UID_DialogTableChild = v.UID_DialogTable where oa.UID_OrgRoot = 'QER-V-ITShopOrg' and dbo.QBM_FGITableName(ba.UID_DialogTableMN) = @TargetTable 
41if @Debugswitch > 0 begin select @DebugMessage = '@TargetView  '+ ISNULL(@TargetView, '<null>') exec QBM_PJournal @debugmessage, @@procid, 'D', @DebugLevel
42 end select @SQLCmdInsert = N'
43 if not exists (select top 1 1
44				 from ' + @TargetTable + '
45				 where XObjectKey = ''' + dbo.QBM_FCVElementToObjectKey2
46(@TargetView, 'UID_ITShopOrg',@uid_orgBO_New, @pkname,dbo.QBM_FCVObjectkeyToElement('ColumnValue1', @ObjectKeyElement)) + '''
47			   )
48	begin
49		insert into '
50 + @TargetTable + '
51		(uid_org, ' + @pkname + '
52		 , Xorigin, XDateinserted, XdateUpdated
53		 , XUserInserted, XUserupdated
54		 , XObjectKey
55					 ) 
56		select '''
57 + @uid_orgBO_New + ''', ''' + dbo.QBM_FCVObjectkeyToElement('ColumnValue1', @ObjectKeyElement) + '''
58		 , 1, ''' + dbo.QBM_FCVDatetimeToString(getutcdate
59()) + ''', ''' + dbo.QBM_FCVDatetimeToString(getutcdate()) + '''
60		, ''' + OBJECT_NAME(@@procid) + ''', ''' + OBJECT_NAME(@@procid) + '''
61		, ''' + dbo.QBM_FCVElementToObjectKey2
62(@TargetView, 'UID_ITShopOrg',@uid_orgBO_New, @pkname,dbo.QBM_FCVObjectkeyToElement('ColumnValue1', @ObjectKeyElement)) + '''
63	end
64	
65	'  if @Debugswitch
66 > 0 begin select @DebugMessage = '@SQLCmdInsert  '+ ISNULL(@SQLCmdInsert, '<null>') exec QBM_PJournal @debugmessage, @@procid, 'D', @DebugLevel end exec
67 QBM_PExecuteSQLWithRetry_LLP @SQLStatement = @SQLCmdInsert , @LockTimeout_ms = 250 , @MaxWaitTimeForLock_s = 20 , @ProcIDForJournal = default , @HandleErrorSilent
68 = 0 select @UID_BaseTreeHasObject = dbo.QBM_FCVStringToGUIDMAll(null, @uid_orgBO_New, @ObjectKeyElement) select @SQLCmdBaetreeHasObject = '
69	insert into BaseTreeHasObject (UID_BaseTreeHasObject, UID_Org, ObjectKey
70									, InheritInfo, XObjectKey
71								)
72		select '''
73 + @UID_BaseTreeHasObject + ''', ''' + @uid_orgBO_New + ''', ''' + @ObjectKeyElement + '''
74									, ' + @StringQERFGIBitPatternInheritInfo_Direct + 
75' , dbo.QBM_FCVElementToObjectKey1(''BaseTreeHasObject'', ''UID_BaseTreeHasObject'', ''' + @UID_BaseTreeHasObject + ''')
76		where Not exists (select top 1 1
77							from BaseTreeHasObject bho
78							where bho.UID_Org = '''
79 + @uid_orgBO_New + '''
80							and bho.ObjectKey = ''' + @ObjectKeyElement + '''

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.853

uses session context values has TRY/CATCH error handling

Summary: calls QBM_PJournal, QBM_PExecuteSQLWithRetry_LLP, QER_PITShopProductNodeCreate, QER_PITShopOrderMove_bulk, QBM_PSessionErrorAdd; writes INSERT into, INSERT BaseTreeHasObject; reads/joins BaseTree, BaseTreeHasObject, BaseTreeAssign, DialogTable, OrgRootAssign…

Declared parameters

ParameterTypeDirection
@uid_OrgPR_Oldvarchar(38)input
@uid_orgBO_newvarchar(38)input

DML targets

INSERT into INSERT BaseTreeHasObject

Config/session

Config: None extracted.

Session: None extracted.

DBQueue/tasks

None extracted.

Temp tables / referenced variables

Temp: #LDS #The #Associate

Variables: @uid_OrgPR_Old @uid_orgBO_new @uid_OrgPR_New @uid_OrgSH_New @uid_OrgCU_New @uid_orgBO_Old @uid_orgSH_Old @uid_orgCU_Old @Ident_OrgBO_New @Ident_OrgSH_New @ObjectKeyElement @UID_AccProduct @SQLCmdDelete @SQLCmdInsert @UID_BaseTreeHasObject @SQLCmdBaetreeHasObject @uid_personwantsorg @BasisObjectKey @TargetTable @TargetView @uid_DialogTableAssigned @pkname @DebugSwitch @DebugLevel @DebugMessage @StringQERFGIBitPatternInheritInfo_Direct @GenProcID @ElementBuffer @ElementCount @ElementIndex @PWOsToMove @QER_BitPatternInherit_Direct @uid_orgBO_New @Debugswitch @debugmessage @procid @uid_OrgBO_Old @uid_accProduct @SQLStatement @LockTimeout_ms

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.

Referencing objectRelationEvidence
dbo.QER_PITShop_PRNodesMoveSQL expression dependencyOBJECT_OR_COLUMN
dbo.QER_PITShop_PRNodesMovesource text referenceuses session context values, has TRY/CATCH error handling