=========================================================================
MARS-1046: ISO 8601 Date Format Fix for FILE_MANAGER
=========================================================================

This script will:
- Update FILE_MANAGER package specification (3.3.0 → 3.3.1)
- Update FILE_MANAGER package body with NORMALIZE_DATE_FORMAT function
- Fix parsing of ISO 8601 formats: YYYY-MM-DDTHH24:MI:SS.FF3TZH:TZM
- Track package version in A_PACKAGE_VERSION_TRACKING

Expected Duration: 1-2 minutes
=========================================================================
Type YES to continue with installation, or Ctrl+C to abort: YES
old:BEGIN
    IF '&continue' IS NULL OR TRIM('&continue') IS NULL OR UPPER(TRIM('&continue')) != 'YES' THEN
        RAISE_APPLICATION_ERROR(-20001, 'Installation aborted by user');
    END IF;
END;

new:BEGIN
    IF 'YES' IS NULL OR TRIM('YES') IS NULL OR UPPER(TRIM('YES')) != 'YES' THEN
        RAISE_APPLICATION_ERROR(-20001, 'Installation aborted by user');
    END IF;
END;

PL/SQL procedure successfully completed.

Elapsed: 00:00:00.088

=========================================================================
Step 1: Update FILE_MANAGER Package Specification
=========================================================================
========================================================================
MARS-1046: Updating CT_MRDS.FILE_MANAGER Package Specification
========================================================================

Package CT_MRDS.FILE_MANAGER compiled

Elapsed: 00:00:00.291

OBJECT_NAME     OBJECT_TYPE    STATUS    
_______________ ______________ _________ 
FILE_MANAGER    PACKAGE        VALID     

Elapsed: 00:00:00.198
SUCCESS: FILE_MANAGER package specification updated to version 3.3.1

=========================================================================
Step 2: Update FILE_MANAGER Package Body
=========================================================================
========================================================================
MARS-1046: Updating CT_MRDS.FILE_MANAGER Package Body
========================================================================

Package Body CT_MRDS.FILE_MANAGER compiled

LINE/COL  ERROR
--------- -------------------------------------------------------------
123/10    PLS-00201: identifier 'VGSOURCEFILECONFIGKEY' must be declared
123/10    PL/SQL: Statement ignored
149/4     PL/SQL: Item ignored
153/11    PLS-00201: identifier 'TSOURCEFILERECEIVED' must be declared
208/7     PL/SQL: Statement ignored
208/33    PLS-00306: wrong number or types of arguments in call to 'REGISTER_SOURCE_FILE_RECEIVED'
296/10    PLS-00201: identifier 'VGMSGTMP' must be declared
296/10    PL/SQL: Statement ignored
298/10    PL/SQL: Statement ignored
298/40    PLS-00201: identifier 'VGMSGTMP' must be declared
299/10    PL/SQL: Statement ignored
299/77    PLS-00201: identifier 'VGMSGTMP' must be declared
308/10    PLS-00201: identifier 'VGMSGTMP' must be declared
308/10    PL/SQL: Statement ignored
326/10    PL/SQL: Statement ignored
326/40    PLS-00201: identifier 'VGMSGTMP' must be declared
327/10    PL/SQL: Statement ignored
327/76    PLS-00201: identifier 'VGMSGTMP' must be declared
429/7     PLS-00313: 'GENERATE_EXTERNAL_TABLE_PARAMS' not declared in this scope
429/7     PL/SQL: Statement ignored
Errors: check compiler log
Elapsed: 00:00:00.454

Package Body CT_MRDS.FILE_MANAGER compiled

LINE/COL  ERROR
--------- -------------------------------------------------------------
123/10    PLS-00201: identifier 'VGSOURCEFILECONFIGKEY' must be declared
123/10    PL/SQL: Statement ignored
149/4     PL/SQL: Item ignored
153/11    PLS-00201: identifier 'TSOURCEFILERECEIVED' must be declared
208/7     PL/SQL: Statement ignored
208/33    PLS-00306: wrong number or types of arguments in call to 'REGISTER_SOURCE_FILE_RECEIVED'
296/10    PLS-00201: identifier 'VGMSGTMP' must be declared
296/10    PL/SQL: Statement ignored
298/10    PL/SQL: Statement ignored
298/40    PLS-00201: identifier 'VGMSGTMP' must be declared
299/10    PL/SQL: Statement ignored
299/77    PLS-00201: identifier 'VGMSGTMP' must be declared
308/10    PLS-00201: identifier 'VGMSGTMP' must be declared
308/10    PL/SQL: Statement ignored
326/10    PL/SQL: Statement ignored
326/40    PLS-00201: identifier 'VGMSGTMP' must be declared
327/10    PL/SQL: Statement ignored
327/76    PLS-00201: identifier 'VGMSGTMP' must be declared
429/7     PLS-00313: 'GENERATE_EXTERNAL_TABLE_PARAMS' not declared in this scope
429/7     PL/SQL: Statement ignored
Errors: check compiler log
Elapsed: 00:00:00.376

OBJECT_NAME     OBJECT_TYPE     STATUS     
_______________ _______________ __________ 
FILE_MANAGER    PACKAGE BODY    INVALID    

Elapsed: 00:00:00.169
SUCCESS: FILE_MANAGER package body updated with ISO 8601 date format fix

=========================================================================
Step 3: Track Package Version
=========================================================================
========================================
Package Version Tracking - MARS-1046
========================================
No packages found in list
========================================


PL/SQL procedure successfully completed.

Elapsed: 00:00:00.094

=========================================================================
Step 4: Verify Package Status
=========================================================================

========================================
Package Version Verification
========================================


PACKAGE_OWNER    PACKAGE_NAME        VERSION    STATUS                                                 
________________ ___________________ __________ ______________________________________________________ 
CT_MRDS          DATA_EXPORTER       2.1.0      OK: Package CT_MRDS.DATA_EXPORTER has not changed.
Last Tracked: 2025-11-25 16:00:35
Version: 2.1.0                                                                                                                                                                                                                                                                                                                                                                                                                                                
CT_MRDS          ENV_MANAGER         3.1.0      OK: Package CT_MRDS.ENV_MANAGER has not changed.
Last Tracked: 2025-11-25 16:00:35
Version: 3.1.0                                                                                                                                                                                                                                                                                                                                                                                                                                                  
CT_MRDS          FILE_ARCHIVER       2.0.0      OK: Package CT_MRDS.FILE_ARCHIVER has not changed.
Last Tracked: 2025-11-25 16:00:36
Version: 2.0.0                                                                                                                                                                                                                                                                                                                                                                                                                                                
CT_MRDS          FILE_MANAGER        3.2.1      WARNING: Package CT_MRDS.FILE_MANAGER has changed!
========================================
Last Tracked Version: 3.2.1
Last Tracked Date: 2025-11-27 08:10:44

SPECIFICATION Changed:
  Current Hash: 6eeb27f0ea738f64...
  Last Hash:    6efa2d75e3c8aef6...

BODY Changed:
  Current Hash: ef2a9364f4117ff1...
  Last Hash:    cf1365d073d38524...

RECOMMENDATION:
1. Update PACKAGE_VERSION constant
2. Update PACKAGE_BUILD_DATE constant
3. Add entry to VERSION_HISTORY
4. Call TRACK_PACKAGE_VERSION to update tracking    
CT_MRDS          WORKFLOW_MANAGER    1.7.1      OK: Package CT_MRDS.WORKFLOW_MANAGER has not changed.
Last Tracked: 2025-11-25 16:00:36
Version: 1.7.1                                                                                                                                                                                                                                                                                                                                                                                                                                             
ODS              FILE_MANAGER_ODS    2.1.0      WARNING: Package ODS.FILE_MANAGER_ODS has changed!
========================================
Last Tracked Version: 2.1.0
Last Tracked Date: 2025-11-26 08:58:57

BODY Changed:
  Current Hash: 1d167a53256c10dd...
  Last Hash:    NULL...

RECOMMENDATION:
1. Update PACKAGE_VERSION constant
2. Update PACKAGE_BUILD_DATE constant
3. Add entry to VERSION_HISTORY
4. Call TRACK_PACKAGE_VERSION to update tracking                                                                                                                    
EnvironmentID set to: dev

Elapsed: 00:00:00.587

========================================
Verification Complete
========================================

Legend:
OK - Package has not changed since last tracking
WARNING - Package code changed without version update

For detailed hash information, use:
SELECT ENV_MANAGER.GET_PACKAGE_HASH_INFO('OWNER', 'PACKAGE') FROM DUAL
========================================

=========================================================================
MARS-1046 Installation - COMPLETED
=========================================================================

FILE_MANAGER updated to version 3.3.1

Verification:
SELECT FILE_MANAGER.GET_VERSION() FROM DUAL
SELECT FILE_MANAGER.GET_BUILD_INFO() FROM DUAL

Check the log file for complete installation details:
INSTALL_MARS_1046_G45C5E88148E17E_GGMICHALSKI_20251127_103105.log
=========================================================================
