-- ============================================================================
-- MARS-1409 Package Version Verification
-- ============================================================================
-- Purpose: Verify package versions after installation
-- ============================================================================

SET SERVEROUTPUT ON SIZE UNLIMITED
SET VERIFY OFF
SET FEEDBACK OFF
SET ECHO OFF

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

-- FILE_MANAGER version
PROMPT
PROMPT CT_MRDS.FILE_MANAGER Package:
SELECT CT_MRDS.FILE_MANAGER.GET_VERSION() AS VERSION FROM DUAL;
SELECT CT_MRDS.FILE_MANAGER.GET_BUILD_INFO() AS BUILD_INFO FROM DUAL;

-- ENV_MANAGER version
PROMPT
PROMPT CT_MRDS.ENV_MANAGER Package:
SELECT CT_MRDS.ENV_MANAGER.GET_VERSION() AS VERSION FROM DUAL;
SELECT CT_MRDS.ENV_MANAGER.GET_BUILD_INFO() AS BUILD_INFO FROM DUAL;

-- Package compilation status
PROMPT
PROMPT Package Compilation Status:
SELECT object_name, object_type, status, last_ddl_time
FROM user_objects
WHERE object_name IN ('FILE_MANAGER', 'ENV_MANAGER')
  AND object_type IN ('PACKAGE', 'PACKAGE BODY')
ORDER BY object_name, object_type;

-- Check for compilation errors
PROMPT
PROMPT Compilation Errors (if any):
SELECT name, type, line, position, text
FROM user_errors
WHERE name IN ('FILE_MANAGER', 'ENV_MANAGER')
ORDER BY name, type, line, position;

PROMPT
PROMPT ============================================================================
PROMPT Verification Complete
PROMPT ============================================================================
