Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

external table

user8786417Jan 7 2014 — edited Jan 9 2014

hi,

i have created some sample data, and created the directory to point to the data source.

If my csv contains headings, as it is an export via sql developer from one of the tables, how can i include the headings from the csv to the external table.

CREATE TABLE emp_external

(

EMPNO NUMBER(4),

ENAME VARCHAR2(10),

JOB VARCHAR2(9),

MGR NUMBER(4),

SAL NUMBER(7,2),

COMM NUMBER(7,2),

DEPTNO NUMBER(2)

)

ORGANIZATION EXTERNAL

(TYPE ORACLE_LOADER

DEFAULT DIRECTORY emp_data

ACCESS PARAMETERS

(RECORDS DELIMITED BY NEWLINE

LOGFILE my_data:'data.log'

BADFILE my_data:'data.bad'

DISCARDFILE my_data:'data.disc'

fields terminated by ','

MISSING FIELD VALUES ARE NULL

)

LOCATION (my_data:'emp.csv')

);

This post has been answered by mtefft on Jan 8 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 6 2014
Added on Jan 7 2014
17 comments
1,337 views