An inconsistency has been identified between two core database tables. Specifically, the unique identifier for certain projects—Investment Code and Project Code—does not match across the systems as expected.
| Table | Column Name | Role |
INV_INVESTMENTS |
CODE |
The primary identifier in the Investment module. |
PAC_MNT_PROJECTS |
PROJECT_CODE |
The primary identifier in the Project module. |
Clarity all release
"unknown reason"—this is often caused by manual data entry/update, a failed integration script, or a legacy system migration.
SELECT INV.ID INV_ID,PAC.ID PAC_ID,INV.CODE INV_CODE,PAC.PROJECT_CODE PAC_PRJ_CODE,
INV.NAME PRJ_NAME,DECODE(INV.IS_ACTIVE,1,'Yes','No') INV_IS_ACTIVE,INITCAP(INV.ODF_OBJECT_CODE) INV_TYPE,
inv.created_date, pac.created_date, inv.created_by,pac.created_by, inv.last_updated_date, pac.last_updated_date, inv.last_updated_by,
pac.last_updated_by
FROM INV_INVESTMENTS INV
JOIN PAC_MNT_PROJECTS PAC ON INV.ID=PAC.ID
AND ((UPPER(INV.CODE)<>UPPER(PAC.PROJECT_CODE)))
CREATE TABLE BKP_INV_INVESTMENTS
AS
SELECT * FROM INV_INVESTMENTS
CREATE TABLE BKP_PAC_MNT_PROJECTS
AS
SELECT * FROM PAC_MNT_PROJECTS
MERGE INTO PAC_MNT_PROJECTS p
USING inv_investments i
ON (i.id = p.id)
WHEN MATCHED THEN
UPDATE SET p.project_code = i.code
WHERE upper(i.CODE) != p.PROJECT_CODE