EXTERNAL
Example
Section titled “Example”CREATE EXTERNAL DATA SOURCE MyAzureBlobStorageWITH ( TYPE = BLOB_STORAGE, LOCATION = 'https://myaccount.blob.core.windows.net', CREDENTIAL = MyAzureBlobStorageCredential );Output
Section titled “Output”Command(s) completed successfully.Explanation
Section titled “Explanation”The example SQL query uses the CREATE EXTERNAL DATA SOURCE statement to create a data source named MyAzureBlobStorage that connect to an Azure Blob Storage. The TYPE is set to BLOB_STORAGE, LOCATION to the URL of the Blob Storage account, and CREDENTIAL to a pre-existing credential. The output indicates the command executed successfully.
Example
Section titled “Example”CREATE TABLE employees_ext (employee_id NUMBER(6), first_name VARCHAR2(20), last_name VARCHAR2(25), hire_date DATE)ORGANIZATION EXTERNAL (TYPE ORACLE_LOADER DEFAULT DIRECTORY def_dir ACCESS PARAMETERS (RECORDS DELIMITED BY NEWLINE FIELDS (employee_id char(3), first_name char(15), last_name char(20), hire_date char(20) date_format DATE mask "dd-mon-yyyy")) LOCATION ('employees.txt'))REJECT LIMIT UNLIMITED;Output
Section titled “Output”No output is produced as CREATE TABLE...ORGANIZATION EXTERNAL doesn’t produce any output. But it let oracle know to treat the data in the specified file as table ‘employees_ext’.
Explanation
Section titled “Explanation”The above SQL creates an external table named ‘employees_ext’. It links to the file ‘employees.txt’ in the directory ‘def_dir’. The ORGANIZATION EXTERNAL clause indicates that it’s an external table. The ACCESS PARAMETERS clause indicates how oracle should interpret the data in the file. The REJECT LIMIT UNLIMITED allows all rows that have format errors to be skipped.