Multidomain MDM
- Multidomain MDM 10.3 HotFix 3
- All Products
CREATE TABLE C_REPOS_EXT_HARD_DEL_DETECT ( ROWID_TABLE CHAR(14 BYTE), HDD_ENABLED INTEGER DEFAULT 0 NOT NULL, HDD_TYPE VARCHAR2(14 BYTE), DELETE_FLAG_COLUMN_NAME VARCHAR2(30 BYTE), DELETE_FLAG_VAL_ACTIVE VARCHAR2(14 BYTE), DELETE_FLAG_VAL_INACTIVE VARCHAR2(14 BYTE), DELETE_FLAG_VAL_PARTIAL VARCHAR2(14 BYTE), HAS_END_DATE INTEGER DEFAULT 0, END_DATE_COLUMN_NAME VARCHAR2(30 BYTE), END_DATE_VAL DATE DEFAULT 'SYSDATE', TRAN_HDD_ENABLED INTEGER DEFAULT 0 HDD_LANDING_PKEY_COLUMNS VARCHAR2(<TBD> BYTE), EMPTY_LANDING_TABLE_CHECK_OFF INTEGER DEFAULT 0 );
CREATE TABLE [dbo].[C_REPOS_EXT_HARD_DEL_DETECT] ( [ROWID_TABLE] [nchar](14) NOT NULL, [HDD_ENABLED] [bigint] NOT NULL, [HDD_TYPE] [nvarchar](14) NULL, [DELETE_FLAG_COLUMN_NAME] [nvarchar](30) NULL, [DELETE_FLAG_VAL_ACTIVE] [nvarchar](14) NULL, [DELETE_FLAG_VAL_INACTIVE] [nvarchar](14) NULL, [DELETE_FLAG_VAL_PARTIAL] [nvarchar](14) NULL, [HAS_END_DATE] [bigint] NULL, [END_DATE_COLUMN_NAME] [nvarchar](30) NULL, [END_DATE_VAL] [datetime2](7) NULL, [TRAN_HDD_ENABLED] [bigint] NULL, [HDD_LANDING_PKEY_COLUMNS] [nvarchar](<TBD>) NULL, [EMPTY_LANDING_TABLE_CHECK_OFF] [bigint] NULL ) ON [CMX_DATA]
ALTER TABLE C_REPOS_EXT_HARD_DEL_DETECT ADD ( CHECK (HDD_TYPE IN ('DIRECT','CONSENSUS'))); ALTER TABLE C_REPOS_EXT_HARD_DEL_DETECT ADD ( CHECK (HDD_ENABLED IN (0,1))); ALTER TABLE C_REPOS_EXT_HARD_DEL_DETECT ADD ( CHECK (HAS_END_DATE IN (0,1))); ALTER TABLE C_REPOS_EXT_HARD_DEL_DETECT ADD ( UNIQUE (ROWID_TABLE));
ALTER TABLE [dbo].[C_REPOS_EXT_HARD_DEL_DETECT] ADD CONSTRAINT [CH_C_REPOS_EXT_HARD_DEL_DETECT_HDD_TYPE] CHECK (HDD_TYPE IN ('CONSENSUS','DIRECT')) GO ALTER TABLE [dbo].[C_REPOS_EXT_HARD_DEL_DETECT] ADD CONSTRAINT [CH_C_REPOS_EXT_HARD_DEL_DETECT_HDD_ENABLED] CHECK (HDD_ENABLED IN (0,1)) GO ALTER TABLE [dbo].[C_REPOS_EXT_HARD_DEL_DETECT] ADD CONSTRAINT [CH_C_REPOS_EXT_HARD_DEL_DETECT_HAS_END_DATE] CHECK (HAS_END_DATE IN (0,1)) GO ALTER TABLE [dbo].[C_REPOS_EXT_HARD_DEL_DETECT] ADD CONSTRAINT [UQ_C_REPOS_EXT_HARD_DEL_DETECT_ROWID_TABLE] UNIQUE (ROWID_TABLE) GO
ALTER TABLE C_REPOS_EXT_HARD_DEL_DETECT ADD ( CONSTRAINT FK_ROWID_TABLE_FOR_HDD FOREIGN KEY (ROWID_TABLE) REFERENCES C_REPOS_TABLE (ROWID_TABLE) ON DELETE CASCADE);
ALTER TABLE [dbo].[C_REPOS_EXT_HARD_DEL_DETECT] ADD CONSTRAINT [FK_ROWID_TABLE_FOR_HDD] FOREIGN KEY (ROWID_TABLE) REFERENCES [dbo].[C_REPOS_TABLE](ROWID_TABLE) ON DELETE CASCADE GO
On Microsoft SQL Server.INSERT INTO C_REPOS_JOB_METRIC_TYPE (METRIC_TYPE_CODE, CREATE_DATE, CREATOR, LAST_UPDATE_DATE, UPDATED_BY, METRIC_TYPE_DESC, SEQ) VALUES (100, SYSDATE, 'hdd', SYSDATE, 'hdd', 'Flagged as Deleted', 100);
INSERT INTO [dbo].[C_REPOS_JOB_METRIC_TYPE] ([METRIC_TYPE_CODE],[CREATE_DATE],[CREATOR],[LAST_UPDATE_DATE],[UPDATED_BY],[METRIC_TYPE_DESC],[SEQ]) VALUES (100,getDate(),'HDD',getDate(),'HDD','Flagged as Deleted',100) GO
INSERT INTO C_REPOS_EXT_HARD_DEL_DETECT ( ROWID_TABLE, HDD_ENABLED, HDD_TYPE, DELETE_FLAG_COLUMN_NAME, DELETE_FLAG_VAL_ACTIVE, DELETE_FLAG_VAL_INACTIVE, DELETE_FLAG_VAL_PARTIAL, HAS_END_DATE, END_DATE_COLUMN_NAME, END_DATE_VAL, TRAN_HDD_ENABLED, HDD_LANDING_PKEY_COLUMNS) SELECT ROWID_TABLE, 1, <Column to enable hard delete detection>,'<hard delete detection type such as DIRECT or CONSENSUS>', '<name of the delete flag column>', '<Value of delete flag column for active records>', '<Value of delete flag column for inactive records>', '<Value of delete flag column for partially active records>', <Indicator whether end date is used in hard delete detection or not>, <End date column name if staging table has end date column>, '<End date value as MM/DD/YYYY>', <Transactional Hard Delete Detection indicator>, '<Comma-separated list of column names that contribute to the primary key>', FROM C_REPOS_TABLE WHERE table_name = '<Staging table name>'
INSERT INTO [dbo].[C_REPOS_EXT_HARD_DEL_DETECT] ([ROWID_TABLE] ,[HDD_ENABLED] ,[HDD_TYPE] ,[DELETE_FLAG_COLUMN_NAME] ,[DELETE_FLAG_VAL_ACTIVE] ,[DELETE_FLAG_VAL_INACTIVE] ,[DELETE_FLAG_VAL_PARTIAL] ,[HAS_END_DATE] ,[END_DATE_COLUMN_NAME] ,[END_DATE_VAL] ,[TRAN_HDD_ENABLED] ,[HDD_LANDING_PKEY_COLUMNS]) SELECT [ROWID_TABLE] ,1--Column for which hard delete detection must be enabled ,'<hard delete detection type such as DIRECT or CONSENSUS>' ,'<name of the delete flag column>' ,'<Value of delete flag column for active records>' ,'<Value of delete flag column for inactive records>' ,'<Value of delete flag column for partially active records>' ,<Indicator whether end date is used in hard delete detection or not> ,<End date column name if staging table has end date column> ,'<End date value>' ,<Transactional Hard Delete Detection indicator> ,'<Comma-separated list of column names that contribute to the primary key>' FROM [dbo].[C_REPOS_TABLE] WHERE table_name = '<Staging table name>' GO