hi I have the following:
The only thing is it would not update anything beyond SFB_COMP=1 ... is there something I am doing wrong here???
The only thing is it would not update anything beyond SFB_COMP=1 ... is there something I am doing wrong here???
Code:
UPDATE sfdcprcbok_history_insert
SET Pricebook2Id =
CASE
WHEN (SFB_COMP=1 AND SFB_PRCSTR=1 AND Name='Retail 1')
THEN [Id]
WHEN (SFB_COMP=2 AND SFB_PRCSTR=1 AND Name='Retail 2')
THEN [Id]
WHEN (SFB_COMP=3 AND SFB_PRCSTR=1 AND Name='Retail 3')
THEN [Id]
WHEN (SFB_COMP=4 AND SFB_PRCSTR=1 AND Name='Retail 4')
THEN [Id]
WHEN (SFB_COMP=6 AND SFB_PRCSTR=1 AND Name='Retail 6')
THEN [Id]
WHEN (SFB_COMP=7 AND SFB_PRCSTR=1 AND Name='Retail 7')
THEN [Id]
WHEN (SFB_COMP=8 AND SFB_PRCSTR=1 AND Name='Retail 8')
THEN [Id]
WHEN (SFB_COMP=9 AND SFB_PRCSTR=1 AND Name='Retail 9')
THEN [Id]
ELSE ''
END
,SFB_INSERT='N'
FROM sfdcprcbok_history_insert Z,SFDCPRCBOK_II C