Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How do I ensure order of rows loaded by SQL Loader?

Re: How do I ensure order of rows loaded by SQL Loader?

From: Jim Kennedy <kennedy-downwithspammersfamily_at_attbi.net>
Date: Thu, 13 Nov 2003 16:11:16 GMT
Message-ID: <E2Osb.137658$mZ5.947489@attbi_s54>


So you should use 2 tables. You can use a trigger to generate the sequence number. Or you can use external tables in 9i to process the file directly. Jim

"Puneet" <puneet.bansal_at_wipro.com> wrote in message news:4c276d80.0311130404.3bcd0581_at_posting.google.com...
> Thanks Jim for your response.
> The correct order is the order specified in the CSV file. The first
> record is the name of a person with a tag attached to it 'Contact'.
> The next 4 records are just names without the keyword 'Contact' in
> them, so I know that these 4 people are associated with the first
> 'Contact'. The next record is again a 'Contact', so I know that this
> is a new contact and then again there are people associated with this
> contact. So if I traverse by order I know which people to associate
> with what contact. So that's why the order bocomes important. You are
> right that I can define a column having sequence numbers but the
> problem is I am loading the data using sql loader. How do I insert
> sequence numbers while loading the data from sql loader? Is there any
> way a sequence number is auto inserted in a column?
>
> Thanks.
> Puneet
>
> "Jim Kennedy" <kennedy-downwithspammersfamily_at_attbi.net> wrote in message
news:<P5Fsb.135158$mZ5.935009_at_attbi_s54>...
> > If you don't have any column to order by then how would you know what
the
> > right order is? By definition the data in a table is unordered and you
> > select a group or ret of records and unless you specify an order then
you
> > can't guarantee the order it comes back. Why not have an extra column
that
> > is the seeded with a sequence and order by that?
> > Why is the order not important? If you don't have a primary key how do
you
> > distinguish one row from another?
> > Jim
> > "Puneet" <puneet.bansal_at_wipro.com> wrote in message
> > news:4c276d80.0311122127.562b3607_at_posting.google.com...
> > > Hi everybody !
> > > I am loading a CSV file into Oracle 8i table using SQL Loader
> > > utility. The data is in such a format that the order of the records is
> > > of paramount importance. But when I retrieve the data from the table
> > > it can be in any order, isn't it?
> > >
> > > My doubts are:
> > > Does SQL Loader always load the records in the same order as that of
> > > the data file?
> > >
> > > If yes then how can I ensure that when I retrive the records they are
> > > always in the same order as the one specified in CSV file? (The table
> > > is just a temp table and it doesn't have any primary key or any column
> > > I can order by.) Will 'order by rowid' solve the problem?
> > >
> > > Thanks for your time and help.
> > >
> > > Puneet
Received on Thu Nov 13 2003 - 10:11:16 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US