Query Files with External Tables

Create and Query a Persistent External Table

Use DBMS_CLOUD.CREATE_EXTERNAL_TABLE for supported object-storage workflows. The following example creates a stable Oracle object over Parquet files:

BEGIN
  DBMS_CLOUD.CREATE_EXTERNAL_TABLE(
    table_name => 'ORDERS_EXT',
    credential_name => 'DATA_STORAGE_CREDENTIAL',
    file_uri_list => '<supported-object-store-uri>/orders/*.parquet',
    column_list => 'order_id NUMBER, order_date DATE, region VARCHAR2(30), amount NUMBER(18,2)',
    format => '{"type":"parquet"}'
  );
END;
/

Query the object with normal Oracle SQL:

SELECT order_id, order_date, region, amount
FROM orders_ext
WHERE order_date >= DATE '2026-07-01';

Use CREATE TABLE... ORGANIZATION EXTERNAL instead when the deployment and source require direct access-driver control. Do not create both forms for the same consumer contract without a documented ownership reason.

For details about CREATE_EXTERNAL_TABLE parameters and credential handling, see DBMS_CLOUD.

Query an Inline External Table

An inline external table places the mapping in the FROM clause. Oracle uses the definition for that statement and does not create a data-dictionary object.

SELECT order_id, order_date, region, amount
FROM EXTERNAL (
       (
         order_id NUMBER,
         order_date DATE,
         region VARCHAR2(30),
         amount NUMBER(18,2)
       )
       TYPE ORACLE_BIGDATA
       DEFAULT DIRECTORY data_pump_dir
       ACCESS PARAMETERS (
         'com.oracle.bigdata.credential.name=DATA_STORAGE_CREDENTIAL
          com.oracle.bigdata.fileformat=parquet'
       )
       LOCATION ('<supported-object-store-uri>/orders/*.parquet')
     ) orders_inline
WHERE order_date >= DATE '2026-07-01';

Use inline access for exploration, diagnostics, and query-specific locations. Use a persistent external table for repeated access, grants, views, statistics, or an application contract.