drop table ods.STANDING_FACILITIES;
BEGIN  
   DBMS_CLOUD.CREATE_EXTERNAL_TABLE(   
      table_name =>'STANDING_FACILITIES',
      credential_name =>'OCI$RESOURCE_PRINCIPAL',  
      file_uri_list =>'https://objectstorage.eu-frankfurt-1.oraclecloud.com/n/frcnomajoc7v/b/mrds_inbox_tst/o/ODS/LM/STANDINGFACILITIES/*.csv',
      format => json_object('type' value 'csv', 'skipheaders' value '1'),   
      field_list => 
       '"A_WORKFLOW_HISTORY_KEY" INTEGER,
        "REFERENCE_DATE" DATE MASK "YYYY-MM-DD",
        "VERSION" INTEGER,
        "MFI_ID" CHAR,
        "MFI_NAME" CHAR,
        "COUNTRY" CHAR,
        "MARGINAL_LENDING_FACILITY" NUMBER,
        "DEPOSIT_FACILITY" NUMBER',
      column_list => 
       '"A_WORKFLOW_HISTORY_KEY" NUMBER,
        "REFERENCE_DATE" DATE,
        "VERSION" NUMBER,
        "MFI_ID" VARCHAR2(200),
        "MFI_NAME" VARCHAR2(500),
        "COUNTRY" VARCHAR2(200),
        "MARGINAL_LENDING_FACILITY" NUMBER,
        "DEPOSIT_FACILITY" NUMBER'
       );
   END;
/ 
--select count(*) from STANDING_FACILITIES;
