DimPurchaseOrderLoad
 DimPurchaseOrderLoad (Variables)
  User Defined Variables
Name Value Expression Description
Y
Configuration setting in SSIS_Configurations that determines if Alerts will be send via e-mail in case of an abend or data problems
DELETE FROM [EnterpriseDW] .[dbo].[DimPurchaseOrder] WHERE PurchaseOrderSK IN ( SELECT PurchaseOrderSK FROM [dbo].[Obsolete_DimPurchaseOrder] obs WHERE obs.DoNotDeleteFlag = 0 )
" DELETE FROM " + (@[User::EDWLinkedServerName] == "N/A" ? "" : "[" + @[User::EDWLinkedServerName]+"]." ) + "["+ @[User::EDWDBName] + "] .[dbo].[DimPurchaseOrder] WHERE PurchaseOrderSK IN ( SELECT PurchaseOrderSK FROM [dbo].[Obsolete_DimPurchaseOrder] obs WHERE obs.DoNotDeleteFlag = 0 ) "
Configuration setting from SSIS_Configuration to specify the domain where the e-mail server is running.
EnterpriseDW
Configuration setting in SSIS_Configurations that specifies the name of the Enterprise Data Warehouse.
N/A
If the Enterprise Data Warehouse resides on a different server from the DWStaging and DWoperations databases, a linked server must be defined and the name populated into the Var_EDWLinkedServername. If it resides on the same server, this setting must be set to ?N/A?. This is a configuration setting from SSIS_Configurations.
The list of files to be attached to the e-mail detailing record counts and data validation issues.
Testing (text maintained in SSIS Configurations table)
The text that will be coded in the body of the e-mail. This is an configuration setting in SSIS_Configurations that will be appended to the end of the e-mail.
C:\DW Local Stuff\SSIS\
The directory on the File System where the files to be attached to the e-mail for notifications will be stored. This is a configuration setting from SSIS_Configurations.
help@hetgroup.org
Configuration setting from SSIS_Configurations that will specify the From E-mail address to be used in e-mail notifications.
datawarehouse
The configuration setting from SSIS_Configurations that specify the password used for the e-mail server when sending e-mail notifications.
ipeterso@hetgroup.org
The configuration setting from SSIS_Configurations that specify the To Email address when sending e-mail notifications. This cannot be multiple e-mail addresses, but can be a distribution list.
windows
The configuration setting from SSIS_Configurations that specify the userid used for the e-mail server when sending e-mail notifications.
DECLARE @IncrementalBeginDtTm datetime = 'Jan 1 1900 12:00AM' /* Date and Time to validate against RowUpdatedOn in Source Tables */ DECLARE @IncrementalEndDtTm datetime = 'Mar 4 2016 10:33AM'SELECT CAST(PO.FISCAL_YEAR + PO.REF_NBR as varchar(12)) as PurchaseOrderAK ,PO.FISCAL_YEAR as FiscalYear ,PO.REF_NBR as PurchaseOrderNumber ,CAST(ISNULL(PO.STATUS, 'N/A') AS VARCHAR(3)) as PoStatusCode ,ISNULL(StatusDesc.STATUS_DESC, 'N/A') as PoStatus ,ISNULL(CAST(PO.REC_STATUS AS VARCHAR(3)), 'N/A') as ReceivingStatusCode ,ISNULL(RecStatDesc.STATUS_DESC, 'N/A') as ReceivingStatus ,ISNULL(CAST(PO.PAY_STATUS AS VARCHAR(3)),'N/A') as PayStatusCode ,ISNULL(PayStatDesc.STATUS_DESC, 'N/A') as PayStatus ,ISNULL(CAST(PO.REF_TYPE AS VARCHAR(3)), 'N/A') as PoTypeCode ,ISNULL(RefTypesDesc.DESCRIPTION, 'N/A') as PoType ,ISNULL(PO.BUYER_ID, 'N/A') as BuyerId ,CAST(ISNULL(BuyerName.BUYER_NAME, 'N/A') AS VARCHAR(30)) AS Buyer FROM FIP_PO_HDR PO LEFT OUTER JOIN UTL_CODE_TABLE RefTypesDesc ON ( RefTypesDesc.TABLE_NAME = 'REF-TYPES' AND RefTypesDesc.CODE = PO.REF_TYPE AND RefTypesDesc.STATUS = 'A' ) LEFT OUTER JOIN FIP_TABLES StatusDesc ON ( StatusDesc.STATUS_CODE = PO.STATUS ) LEFT OUTER JOIN FIP_TABLES RecStatDesc ON ( RecStatDesc.STATUS_CODE = PO.REC_STATUS ) LEFT OUTER JOIN FIP_TABLES PayStatDesc ON ( PayStatDesc.STATUS_CODE = PO.PAY_STATUS ) LEFT OUTER JOIN FIP_TABLES BuyerName ON ( BuyerName.BUYER_ID = PO.BUYER_ID ) WHERE (CAST(PO.FISCAL_YEAR + PO.REF_NBR as varchar(12))) IN ( /* Select changed records from Student File */ SELECT CAST(FISCAL_YEAR + REF_NBR as varchar(12)) FROM FIP_PO_HDR WHERE ( FIP_PO_HDR.RowUpdatedOn >= @IncrementalBeginDtTm AND FIP_PO_HDR.RowUpdatedOn <= @IncrementalEndDtTm ) )
"DECLARE @IncrementalBeginDtTm datetime = '" + @[User::IncrementalBeginDtTm] + "' /* Date and Time to validate against RowUpdatedOn in Source Tables */ DECLARE @IncrementalEndDtTm datetime = '" + @[User::IncrementalEndDtTm] + "'SELECT CAST(PO.FISCAL_YEAR + PO.REF_NBR as varchar(12)) as PurchaseOrderAK ,PO.FISCAL_YEAR as FiscalYear ,PO.REF_NBR as PurchaseOrderNumber ,CAST(ISNULL(PO.STATUS, 'N/A') AS VARCHAR(3)) as PoStatusCode ,ISNULL(StatusDesc.STATUS_DESC, 'N/A') as PoStatus ,ISNULL(CAST(PO.REC_STATUS AS VARCHAR(3)), 'N/A') as ReceivingStatusCode ,ISNULL(RecStatDesc.STATUS_DESC, 'N/A') as ReceivingStatus ,ISNULL(CAST(PO.PAY_STATUS AS VARCHAR(3)),'N/A') as PayStatusCode ,ISNULL(PayStatDesc.STATUS_DESC, 'N/A') as PayStatus ,ISNULL(CAST(PO.REF_TYPE AS VARCHAR(3)), 'N/A') as PoTypeCode ,ISNULL(RefTypesDesc.DESCRIPTION, 'N/A') as PoType ,ISNULL(PO.BUYER_ID, 'N/A') as BuyerId ,CAST(ISNULL(BuyerName.BUYER_NAME, 'N/A'
This variable contains the SQL query that will retrieve the data from the source system.
Jan 1 1900 12:00AM
The IncrementalBeginDtTm setting will contain the start date and time for which updates will be extracted. This is a configuration setting from SSIS_Configurations that are set in the Control Package.
Mar 4 2016 10:33AM
The IncrementalEndDtTm setting will contain the End Date and Time for which updates will be extracted. These values will be compared against the RowUpdatedOn column on the tables in the DWStaging database to determine which rows to extract and load into the Enterprise Data Warehouse.
/* SQL INSERT into DimPurchaseOrderfrom New Temp Table */ INSERT INTO [EnterpriseDW].[dbo].[DimPurchaseOrder] (PurchaseOrderAK ,FiscalYear ,PurchaseOrderNumber ,PoStatusCode ,PoStatus ,ReceivingStatusCode ,ReceivingStatus ,PayStatusCode ,PayStatus ,PoTypeCode ,PoType ,BuyerId ,Buyer ,RowIsCurrent ,RowStartDate ,RowEndDate) SELECT PurchaseOrderAK ,FiscalYear ,PurchaseOrderNumber ,PoStatusCode ,PoStatus ,ReceivingStatusCode ,ReceivingStatus ,PayStatusCode ,PayStatus ,PoTypeCode ,PoType ,BuyerId ,Buyer ,RowIsCurrent ,RowStartDate ,RowEndDate FROM dbo.Staged_dbo_DimPurchaseOrder__New
" /* SQL INSERT into DimPurchaseOrderfrom New Temp Table */ INSERT INTO " + (@[User::EDWLinkedServerName] == "N/A" ? "" : "[" + @[User::EDWLinkedServerName]+"]." ) + "["+ @[User::EDWDBName] + "].[dbo].[DimPurchaseOrder] (PurchaseOrderAK ,FiscalYear ,PurchaseOrderNumber ,PoStatusCode ,PoStatus ,ReceivingStatusCode ,ReceivingStatus ,PayStatusCode ,PayStatus ,PoTypeCode ,PoType ,BuyerId ,Buyer ,RowIsCurrent ,RowStartDate ,RowEndDate) SELECT PurchaseOrderAK ,FiscalYear ,PurchaseOrderNumber ,PoStatusCode ,PoStatus ,ReceivingStatusCode ,ReceivingStatus ,PayStatusCode ,PayStatus ,PoTypeCode ,PoType ,BuyerId ,Buyer ,RowIsCurrent ,RowStartDate ,RowEndDate FROM dbo.Staged_dbo_DimPurchaseOrder__New "
This variable contains the string that will be used to insert any new rows into the DimPurchaseOrder table.
0
The number of rows that were loaded into the Dimension. This is will be compared against the row count from the source system.
/* Sample Update Type1 to Dim */ UPDATE [EnterpriseDW].[dbo].[DimPurchaseOrder] SET PurchaseOrderAK = SCD1.PurchaseOrderAK ,FiscalYear = SCD1.FiscalYear ,PurchaseOrderNumber = SCD1.PurchaseOrderNumber ,PoStatusCode = SCD1.PoStatusCode ,PoStatus = SCD1.PoStatus ,ReceivingStatusCode = SCD1.ReceivingStatusCode ,ReceivingStatus = SCD1.ReceivingStatus ,PayStatusCode = SCD1.PayStatusCode ,PayStatus = SCD1.PayStatus ,PoTypeCode = SCD1.PoTypeCode ,PoType = SCD1.PoType ,BuyerId = SCD1.BuyerId ,Buyer = SCD1.Buyer FROM [EnterpriseDW].[dbo].[DimPurchaseOrder] AS [DIM] INNER JOIN [dbo].[Staged_dbo_DimPurchaseOrder__Type1Update] AS SCD1 ON Dim.PurchaseOrderAK = SCD1.PurchaseOrderAK
" /* Sample Update Type1 to Dim */ UPDATE " + (@[User::EDWLinkedServerName] == "N/A" ? "" : "[" + @[User::EDWLinkedServerName]+"]." ) + "["+ @[User::EDWDBName] + "].[dbo].[DimPurchaseOrder] SET PurchaseOrderAK = SCD1.PurchaseOrderAK ,FiscalYear = SCD1.FiscalYear ,PurchaseOrderNumber = SCD1.PurchaseOrderNumber ,PoStatusCode = SCD1.PoStatusCode ,PoStatus = SCD1.PoStatus ,ReceivingStatusCode = SCD1.ReceivingStatusCode ,ReceivingStatus = SCD1.ReceivingStatus ,PayStatusCode = SCD1.PayStatusCode ,PayStatus = SCD1.PayStatus ,PoTypeCode = SCD1.PoTypeCode ,PoType = SCD1.PoType ,BuyerId = SCD1.BuyerId ,Buyer = SCD1.Buyer FROM " + (@[User::EDWLinkedServerName] == "N/A" ? "" : "[" + @[User::EDWLinkedServerName]+"]." ) + "["+ @[User::EDWDBName] + "].[dbo].[DimPurchaseOrder] AS [DIM] INNER JOIN [dbo].[Staged_dbo_DimPurchaseOrder__Type1Update] AS SCD1 ON Dim.PurchaseOrderAK = SCD1.PurchaseOrderAK "
The SQL string that will update any changed rows in the DimPurchaseOrder dimension.
c:\stubfile.txt
Temporary file name that will be used to create the e-mail notifications. This is a configuration setting from SSIS_Configurations.
25
The SMTPPort for the e-mail server to be used when sending notification e-mails. This is a configuration setting from SSIS_Configurations.
www.ad.hetgroup.org
The SMTP Server Name contains the name for the e-mail server. This is a configuration setting from SSIS_Configurations.
0
This is the Row count from the Source System to compare against that of the DimCurriculum table to ensure that all records were copied.
  System Variables
Name Value Expression Description
Powered by BI Documenter