CSV file import into Oracle
An example to show how to upload a CSV file into an Oracle database usin SQL Loader.
Closed Caption:
I let's see how can we simply upload a
CSV file into oracle first of all let's
find something that we could upload for
this I am be stopped
250 would be good top 250 movies
okay first of all let's save it into csv
for this wheel's XL now as you can see
there are four columns that we should be
uploaded into oracle drank creating
title and votes here I just clear this
table as you can see here all the four
columns that I mentioned when creating
title and words i created this SQL
script a bit earlier but now you can see
it if we show the user tables receives
not created well let's create it
ok they were created and it is something
we remove the header from the csv file
because we don't want to load it into
the database and the comedy which is a
number should be four mothers number so
we remove this coma from here we see it
is a number and just the second and
don't use the comma separator cool now
let's save it
I've created the folder of course for it
and let's name it
IMDb top 250 and it should be a cs3 save
it okay let's see what we have you see
here we have the csv file that's what we
want to load into the database as you
can see the separator is Sam McCollum
block for me I chose semicolon because
there are some movie titles that have
commas inside and it would prevent the
uploading so let's say it was something
that is not inside any of the values
ok now how can we load it for loading
with only this anymore for loading after
we created a table we need a contour
file that describes the comma separated
value file here you can see the control
find in this I tell what is the name of
the file that i want to upload well do I
want to put better records and their do
i want to put the discarded records i
want to insert it and I want to insert
it into IMDb top 250 people that I just
have created before here and here i tell
how I the fields are terminated they are
terminated by bison column as you can
see here that other semicolons
ok and in the control file i tell the
names of the record well of the fields
ok and then I need a file that will
invoke the control file for this you can
see i created a batch file and it will
invoke SQL loader that is it you can
find it here in other claw binary SQL a
dr they don't so i avoid this command
usually in password database and I tell
it which control file should it use that
is only be top 250 CDL ok let's see how
it works we open a comment . with CM
beam and then i just type the name of
the batch mile and I dammit
as you can see there are 250 logical
records a plus sales if I check the lock
file i can see that everything went fine
or the records are loaded and none of
them were bad records
not if I check my table i can see that
that under 250 that helps build up that
song
Video Length: 04:52
Uploaded By: woolfool
View Count: 58,969