Database Administration (MOSC)

MOSC Banner

How to create table from external table

edited Apr 4, 2013 10:42AM in Database Administration (MOSC) 2 commentsAnswered
Hello,

I have a csv file with header that contains name, city, job, empty cell,  and classes.  I would like to create an external table
to read the csv file and create 3 tables: Student, class, and city. 

name      city         job          classes  
SanSmith,Los Angeles,Administrative,,Algeba 101
SanSmith,Los Angeles,Administrative,,English 50
BobDixon,San Diego,salesman,,Unix

My schemas look like
 
student
(id number(4),
 name varchar2(40),
 city_code number(2),
 job_description varchar2(40)
)

class
(id number(4),
 student_id number(4),
 class_description varchar2(40)
)

city
(id number(4),
city_name varchar2(40)
)

I read in los angeles as a city name, but store in student table as a number. The city table have been populated with data already.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center