/*
================================================================================
MARS-1056: Update FILE_MANAGER package with corrected VARCHAR2 definitions
Script: 01_MARS_1056_update_FILE_MANAGER_package.sql
Author: Grzegorz Michalski
Date: November 25, 2025
Purpose: Implementation of VARCHAR2 definition fixes in GENERATE_EXTERNAL_TABLE_PARAMS
================================================================================
*/

SET SERVEROUTPUT ON SIZE UNLIMITED

PROMPT ===================================================================
PROMPT Installing corrected FILE_MANAGER package (MARS-1056)
PROMPT Fix: VARCHAR2 definitions will preserve CHAR/BYTE semantics
PROMPT ===================================================================

-- Install updated FILE_MANAGER specification
@@new_version/FILE_MANAGER.pkg

-- Install updated FILE_MANAGER body with VARCHAR2 fixes
@@new_version/FILE_MANAGER.pkb

-- Verify compilation (ADMIN user checks CT_MRDS schema)
SELECT object_name, object_type, status 
FROM all_objects 
WHERE owner = 'CT_MRDS'
  AND object_name = 'FILE_MANAGER' 
  AND object_type IN ('PACKAGE', 'PACKAGE BODY');

-- Check for compilation errors (ADMIN user checks CT_MRDS schema)
SELECT * FROM all_errors 
WHERE owner = 'CT_MRDS' 
  AND name = 'FILE_MANAGER';

PROMPT ===================================================================
PROMPT MARS-1056: FILE_MANAGER package updated with VARCHAR2 definition fixes
PROMPT ===================================================================

/