Skip to Main Content

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question, RC.

Asked: September 27, 2017 - 3:13 pm UTC

Last updated: September 28, 2017 - 4:17 pm UTC

Version: Oracle 10 or higher

Viewed 1000+ times

You Asked

Hi All,

I am new to oracle external table concepts. Have a very basic query -
if i have a csv with the below columns
Col1, Col2, Col3 Col4 .... Coln

and i want to insert only Col3 & Col4 into an oracle external table ,
what would be my create table statement.
Basically, can i select certain columns to bring to oracle DB using external tables rather then getting the complete csv?
Thanks,
R

and Chris said...

Any particular reason you need to exclude these from the table definition vs. only selecting columns 3 & 4?

If field three always starts at a particular column in the table you could use positional notation to define it and field four.

http://docs.oracle.com/database/122/SUTIL/ORACLE_LOADER-access-driver.htm#SUTIL1414

I'm not seeing what benefit this gives you though. As far as I know, the database will still load the whole line even if you only read part of it.



Is this answer out of date? If it is, please let us know via a Comment

More to Explore

Design

New to good database design? Check out Chris Saxon's full fundamentals class.