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/STANDING_FACILITIES/*.csv',
      format => json_object('type' value 'csv', 'skipheaders' value '1'),   
      field_list => 
       '"REFERENCE_DATE" CHAR,
        "VERSION" CHAR,
        "MFI_ID" CHAR,
        "MFI_NAME" CHAR,
        "COUNTRY" CHAR,
        "MARGINAL_LENDING_FACILITY" CHAR,
        "DEPOSIT_FACILITY" CHAR',
      column_list => 
       '"REFERENCE_DATE" VARCHAR2(200),
        "VERSION" VARCHAR2(200),
        "MFI_ID" VARCHAR2(200),
        "MFI_NAME" VARCHAR2(500),
        "COUNTRY" VARCHAR2(200),
        "MARGINAL_LENDING_FACILITY" VARCHAR2(200),
        "DEPOSIT_FACILITY" VARCHAR2(200)'
       );
   END;
/ 
--select count(*) from STANDING_FACILITIES;
