|
-
This is how to use a view to see the data from the file, but not load it:
Consider a data file "emp_load.dat"
This file emp_load.dat should be located in the physical directory "E:\oracleWork" identified by the directory object TEST_FILES.
The DDL to create the external table will be as follows:
CREATE TABLE emp_external
( emp_id NUMBER(4)
, ename VARCHAR2(12)
, job VARCHAR2(12)
, mgr_id NUMBER(4)
, hiredate DATE
, salary NUMBER(8)
, comm NUMBER(8)
, dept_id NUMBER(2))
ORGANIZATION EXTERNAL
(TYPE oracle_loader
DEFAULT DIRECTORY TEST_FILES
ACCESS PARAMETERS (records delimited BY newline
fields terminated BY ',')
LOCATION ('emp_load.dat')
);
To view the data, all you have to do is query the table like a regular table viz:
SELECT * FROM emp_external;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|