-- ===================================================================
-- MARS-1046 Test: Create Template Table for ISO 8601 Testing
-- ===================================================================
-- Purpose: Create template table with ISO 8601 timestamp columns
-- Author: Grzegorz Michalski
-- Date: 2025-11-27
-- ===================================================================

SET SERVEROUTPUT ON;

PROMPT Creating ISO8601_TEST_DATA template table...

-- Create template table in CT_ET_TEMPLATES schema
CREATE TABLE CT_ET_TEMPLATES.ISO8601_TEST_DATA (
    ID NUMBER NOT NULL,
    EVENT_NAME VARCHAR2(100),
    EVENT_TIMESTAMP TIMESTAMP(3) WITH TIME ZONE,
    DESCRIPTION VARCHAR2(500)
);

COMMENT ON TABLE CT_ET_TEMPLATES.ISO8601_TEST_DATA IS 'Test template for ISO 8601 date format validation (MARS-1046)';
COMMENT ON COLUMN CT_ET_TEMPLATES.ISO8601_TEST_DATA.ID IS 'Unique identifier';
COMMENT ON COLUMN CT_ET_TEMPLATES.ISO8601_TEST_DATA.EVENT_NAME IS 'Event name';
COMMENT ON COLUMN CT_ET_TEMPLATES.ISO8601_TEST_DATA.EVENT_TIMESTAMP IS 'ISO 8601 timestamp with milliseconds and timezone';
COMMENT ON COLUMN CT_ET_TEMPLATES.ISO8601_TEST_DATA.DESCRIPTION IS 'Event description';

PROMPT SUCCESS: Template table created

-- Verify creation
SELECT table_name, num_rows 
FROM all_tables 
WHERE owner = 'CT_ET_TEMPLATES' 
  AND table_name = 'ISO8601_TEST_DATA';

PROMPT
PROMPT Next steps:
PROMPT 1. Configure source in FILE_MANAGER
PROMPT 2. Create test CSV file
PROMPT 3. Upload to OCI INBOX bucket
PROMPT 4. Process file with PROCESS_SOURCE_FILE
PROMPT ===================================================================
