You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Virtual_EDW/Templates/templateLinkSatelliteDrivingKeyInsertInto.Handlebars
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1,31 +1,31 @@
1
1
{{#eachdataObjectMappings}}{{#if@first}}
2
2
--
3
-
-- Link Satellite Insert Into statement for {{targetDataObject.name}}
3
+
-- Link-Satellite Insert Into statement for {{targetDataObject.name}}.
4
+
--
5
+
-- This template inserts the data delta that has been detected into the landing area table.
4
6
--
5
7
6
-
INSERT INTO [{{targetDataObject.name}}]
8
+
INSERT INTO [{{targetDataObject.dataObjectConnection.extensions.0.value}}].[{{targetDataObject.dataObjectConnection.extensions.1.value}}].[{{targetDataObject.name}}]
FROM [{{../metadataConfiguration.vdwSchemaName}}].[{{targetDataObject.name}}] sat_view
31
31
LEFT OUTER JOIN [{{targetDataObject.dataObjectConnection.extensions.0.value}}].[{{targetDataObject.dataObjectConnection.extensions.1.value}}].[{{targetDataObject.name}}] sat_table
Copy file name to clipboardExpand all lines: Virtual_EDW/Templates/templateLinkSatelliteDrivingKeyView.Handlebars
+41-35Lines changed: 41 additions & 35 deletions
Original file line number
Diff line number
Diff line change
@@ -12,80 +12,86 @@ SELECT
12
12
HASHBYTES('MD5', {{#eachbusinessKeys}}{{#unless@first}} +{{/unless}}{{!-- Create the Surrogate Key using the Business Key and components --}}{{#eachbusinessKeyComponentMapping}}
{{/each}}{{/each}}DATEADD(mcs,[{{../metadataConfiguration.sourceRowIdAttribute}}], {{../metadataConfiguration.loadDateTimeAttribute}}) AS {{../metadataConfiguration.loadDateTimeAttribute}},
17
-
COALESCE (
18
-
LEAD (DATEADD(mcs,[{{../metadataConfiguration.sourceRowIdAttribute}}], {{../metadataConfiguration.loadDateTimeAttribute}}) ) OVER
ORDER BY {{../metadataConfiguration.loadDateTimeAttribute}}),
22
-
CAST( '9999-12-31' AS DATETIME)
23
-
) AS LOAD_END_DATETIME,
24
-
CASE
25
-
WHEN ( LEAD ({{../metadataConfiguration.loadDateTimeAttribute}}) OVER (PARTITION BY {{#eachbusinessKeys}}{{#eachBusinessKeyComponentMapping}}{{#eachSourceDataItems}}{{#stringcomparedataItemClassification.0.classification"DrivingKey"}}{{../../targetDataItem.name}}{{#unless@last}},{{/unless}}{{/stringcompare}}{{/each}}{{/each}}{{/each}}
26
-
ORDER BY {{../metadataConfiguration.loadDateTimeAttribute}})) IS NULL
27
-
THEN 'Y'
28
-
ELSE 'N'
29
-
END AS CURRENT_RECORD_INDICATOR,
30
-
-1 AS {{../metadataConfiguration.etlProcessAttribute}}, {{!-- List out the ETL Framework attributes --}}
-- ORDER BY {{../metadataConfiguration.loadDateTimeAttribute}}),
24
+
-- CAST( '9999-12-31' AS DATETIME)
25
+
--) AS [{{../metadataConfiguration.expiryDateTimeAttribute}}],
26
+
--CASE
27
+
-- WHEN ( LEAD ({{../metadataConfiguration.loadDateTimeAttribute}}) OVER (PARTITION BY {{#eachbusinessKeys}}{{#eachBusinessKeyComponentMapping}}{{#eachSourceDataItems}}{{#stringcomparedataItemClassification.0.classification"DrivingKey"}}{{../../targetDataItem.name}}{{#unless@last}},{{/unless}}{{/stringcompare}}{{/each}}{{/each}}{{/each}}
28
+
-- ORDER BY {{../metadataConfiguration.loadDateTimeAttribute}})) IS NULL
29
+
-- THEN 'Y'
30
+
-- ELSE 'N'
31
+
--END AS CURRENT_RECORD_INDICATOR,
32
+
-1 AS {{../metadataConfiguration.etlProcessAttribute}}, {{!-- List out the Control Framework attributes --}}
{{/each}}{{/each}}) AS {{../metadataConfiguration.recordChecksumAttribute}},
41
+
{{/each}}{{/each}}) AS [{{../metadataConfiguration.recordChecksumAttribute}}],
42
+
{{#eachdataItemMappings}}
43
+
[{{targetDataItem.name}}],
44
+
{{/each}}
42
45
CAST (
43
46
ROW_NUMBER() OVER (PARTITION BY {{#eachbusinessKeys}}{{#eachBusinessKeyComponentMapping}}{{#eachSourceDataItems}}{{#stringcomparedataItemClassification.0.classification"DrivingKey"}}{{../../targetDataItem.name}}{{#unless@last}},{{/unless}}{{/stringcompare}}{{/each}}{{/each}}{{/each}}
44
47
ORDER BY {{#eachbusinessKeys}}{{#eachBusinessKeyComponentMapping}}{{#eachSourceDataItems}}{{#stringcomparedataItemClassification.0.classification"DrivingKey"}}{{../../targetDataItem.name}}{{#unless@last}},{{/unless}}{{/stringcompare}}{{/each}}{{/each}}{{/each}}, {{../metadataConfiguration.loadDateTimeAttribute}}
[{{sourceDataItems.0.name}}] AS [{{targetDataItem.name}}],{{/each}}{{/each}}
56
-
{{#eachbusinessKeys}}{{#eachBusinessKeyComponentMapping}}{{#eachSourceDataItems}}{{#stringdiffdataItemClassification.0.classification"DrivingKey"}}LAG ([{{../name}}], 1, '0') OVER (
58
+
{{#eachdataItemMappings}}
59
+
[{{sourceDataItems.0.name}}] AS [{{targetDataItem.name}}],
60
+
{{/each}}
61
+
{{#eachbusinessKeys}}{{#eachBusinessKeyComponentMapping}}{{#eachSourceDataItems}}{{#stringdiffdataItemClassification.0.classification"DrivingKey"}}LAG ([{{../name}}], 1, '0') OVER (
57
62
PARTITION BY {{#each../../../../businessKeys}}{{#eachBusinessKeyComponentMapping}}{{#eachSourceDataItems}}{{#stringcomparedataItemClassification.0.classification"DrivingKey"}}{{name}}{{#unless@last}},{{/unless}}{{/stringcompare}}{{/each}}{{/each}}{{/each}}
58
63
ORDER BY [{{../../../../../metadataConfiguration.loadDateTimeAttribute}}]
59
64
) AS PREVIOUS_FOLLOWER_KEY{{@index}}{{/stringdiff}}{{/each}}{{/each}}{{/each}}
60
65
FROM [{{sourceDataObjects.0.dataObjectConnection.extensions.1.value}}].[{{sourceDataObjects.0.name}}]
61
66
WHERE NOT
62
-
([{{../metadataConfiguration.sourceRowIdAttribute}}]>1 AND [{{../metadataConfiguration.changeDataCaptureAttribute}}] ='Delete')
67
+
([{{../metadataConfiguration.sourceRowIdAttribute}}]>1 AND [{{../metadataConfiguration.changeDataCaptureAttribute}}] ='D')
{{#eachbusinessKeys}}{{#eachBusinessKeyComponentMapping}}{{#eachSourceDataItems}}{{#stringdiffdataItemClassification.0.classification"DrivingKey"}}'{{@index}}' AS PREVIOUS_FOLLOWER_KEY{{@index}}{{/stringdiff}}{{/each}}{{/each}}{{/each}}
73
78
FROM
74
79
(
75
80
SELECT
76
81
'1900-01-01' AS [{{../metadataConfiguration.loadDateTimeAttribute}}],
82
+
1 AS [{{../metadataConfiguration.sourceRowIdAttribute}}],
77
83
'1900-01-01' AS [{{../metadataConfiguration.eventDateTimeAttribute}}],
78
-
'Data Warehouse' AS [{{../metadataConfiguration.recordSourceAttribute}}],
79
-
0 AS [{{../metadataConfiguration.sourceRowIdAttribute}}],
80
-
'N/A' AS [{{../metadataConfiguration.changeDataCaptureAttribute}}],{{#eachbusinessKeys}}
84
+
--'Data Warehouse' AS [{{../metadataConfiguration.recordSourceAttribute}}],
85
+
'C' AS [{{../metadataConfiguration.changeDataCaptureAttribute}}],{{#eachbusinessKeys}}
81
86
{{#eachbusinessKeyComponentMapping}}[{{sourceDataItems.0.name}}] AS [{{targetDataItem.name}}],
82
87
{{/each}}{{/each}}DENSE_RANK() OVER (
83
88
PARTITION BY {{#eachbusinessKeys}}{{#eachBusinessKeyComponentMapping}}{{#eachSourceDataItems}}{{#stringcomparedataItemClassification.0.classification"DrivingKey"}}{{name}}{{#unless@last}},{{/unless}}{{/stringcompare}}{{/each}}{{/each}}{{/each}}
84
-
ORDER BY [{{../metadataConfiguration.loadDateTimeAttribute}}], {{#eachbusinessKeys}}{{#eachBusinessKeyComponentMapping}}{{#eachSourceDataItems}}{{#stringcomparedataItemClassification.0.classification"DrivingKey"}}{{name}}{{#unless@last}},{{/unless}}{{/stringcompare}}{{/each}}{{/each}}{{/each}} ASC
89
+
ORDER BY [{{../metadataConfiguration.loadDateTimeAttribute}}], [{{../metadataConfiguration.sourceRowIdAttribute}}], {{#eachbusinessKeys}}{{#eachBusinessKeyComponentMapping}}{{#eachSourceDataItems}}{{#stringcomparedataItemClassification.0.classification"DrivingKey"}}{{name}}{{#unless@last}},{{/unless}}{{/stringcompare}}{{/each}}{{/each}}{{/each}} ASC
85
90
) AS ROWVERSION
86
91
FROM [{{sourceDataObjects.0.dataObjectConnection.extensions.1.value}}].[{{sourceDataObjects.0.name}}]
Copy file name to clipboardExpand all lines: Virtual_EDW/Templates/templateLinkSatelliteInsertInto.Handlebars
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,20 @@
1
1
{{#eachdataObjectMappings}}{{#if@first}}
2
2
--
3
-
-- Link Satellite Insert Into statement for {{targetDataObject.name}}
3
+
-- Link-Satellite Insert Into statement for {{targetDataObject.name}}.
4
+
--
5
+
-- This template inserts the data delta that has been detected into the landing area table.
4
6
--
5
7
6
-
INSERT INTO [{{targetDataObject.name}}]
8
+
INSERT INTO [{{targetDataObject.dataObjectConnection.extensions.0.value}}].[{{targetDataObject.dataObjectConnection.extensions.1.value}}].[{{targetDataObject.name}}]
FROM [{{../metadataConfiguration.vdwSchemaName}}].[{{targetDataObject.name}}] sat_view
31
31
LEFT OUTER JOIN [{{targetDataObject.dataObjectConnection.extensions.0.value}}].[{{targetDataObject.dataObjectConnection.extensions.1.value}}].[{{targetDataObject.name}}] sat_table
0 commit comments