txt')
14 );
Table created.
SQL>
The first three lines of the command look like a standard create table command. The organization
external clause specifies that this table??™s data is stored external to the database. Using the oracle_
loader clause specifies the access driver to create and load an external table as read-only. The file
specified in the location clause, empl_sugg.txt, is located in the Oracle directory empl_comment_
dir, which you created earlier. The access parameters specify that each row of the table is on its
own line in the text file and that the fields in the text file are separated by a comma.
NOTE
Using an access driver of oracle_datapump instead of oracle_loader
allows you to unload your data to an external table; other than this initial
unload, the external table is accessible for read access only through
the oracle_datapump access driver and has the same restrictions as an
external table created with the oracle_loader access driver.
Once the table is created, the data is immediately accessible in a select statement, as if it had
been loaded into a real table, as you can see in this example:
SQL> select * from empl_sugg;
EMPLOYEE_ID EMPL_COMMENT
----------- --------------------------------------------------
101 The cafeteria serves lousy food.
138 We need a raise.
112 There are not enough bathrooms in Building 5.
138 I like the new benefits plan.
SQL>
Chapter 16: Managing Large Databases 557
Any changes made to the text file will automatically be available the next time you execute
the select statement.
Pages:
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833