Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to load ascii file in oracle table
Ban Spam <ban-spam_at_operamail.com> wrote in message news:<Xns9145B437E7F5FSunnySD_at_24.0.3.73>...
> daniel.st-jacques_at_ca.kontron.com (Daniel St-Jacques) wrote in
> news:2355c0e9.0110250942.36963614_at_posting.google.com:
>
> > Hello all
> >
> > I am new in the Oracle / SQL world.
> >
> > I need help.
> >
> > Here is my problem.
> >
> > I need to create a program that will load an ASCII file into an Orcale
> > Table.
> >
> > ASCII FILE: file.txt
> > Contents: 123,Joe Blow,123 lost,somewhere,nowhere
> > 124,Mary Jains,324 where,city,country
> >
> > Oracle Table: CUST-NUM
> > NAME
> > ADDRESS
> > CITY
> > ZIP
> > COUNTRY
> >
> > I need to do an SQL program that will check if the customer exist.
> > If it exist, the program has to update the oracle table with the
> > information from the ascii file.
> > If it is not exist, the program has to create the customer into the
> > oracle table.
> >
> > Is someone can help me PLEASE.
> >
> > Thank you
> >
> > You can send my your suggestion at
> > daniel.st-jacques_at_ca.kontron.com
> > or
> > stjacqd_at_hotmail.com
> >
> > Thank you again
> >
>
> SQLLDR utility supplied by Oracle will load your data.
> Load it into a TEMP/WORK table & then use SQL to INSERT
> the new records.
>
> What happens when the names match but the rest of the fields
> are different?
Thank you for the answer but I don't know how to use the SQLLDR.
Should I start a SQL to create a table ( CREATE TABLE X ... )
Than launch the SQLLDR ? How the SQLLDR works. I try to understand the
SQLLDR section in the Utilities manual but it is look like that I am
totally dump. I don't understand how to make that stuff working for
me.
I create an ascii file with the LOAD INFILE customer.txt INTO TABLE X
...
but the system still give me errors. I never used Oracle before. So
for me it is a bit complex to understand.
Please if possible can you give by a step by step solution THANK YOU Received on Fri Oct 26 2001 - 08:01:27 CDT