Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: "Fast" Query of Multiple Columns?
Try this:
create a table ( say, new_loc_table, with 2 columns old_loc and new_loc ) from the flat file...
modify the old_loc_table by adding a field called actual_old_loc
update the old_loc_table and set actual_old_loc = ltrim(rtrim(col1||col2||to_char(col3)))
[Note: if col3 ( the fp number ) has a decimal point in it the to_char function may need a format model]
Index actual_old_loc in old_loc_table
This should give you 1 field that has the old locator..The rest is easy..
update old_loc_table set new_loc_field = (select new_loc from new_loc_table where old_loc = actual_old_loc)
hth,
Peter Stryjewski <pstryjew_at_worldnet.att.net> wrote:
>Hello All,
>
>I'm looking for the fastest method of querying multiple columns in a
>database and populating a new column.
>
>What I have:
>Flat file of old locator number and new locator number
>Table with "old" locator number in any one of 3 columns(two are strings
>on is a fp number type). All are indexes.
>Table is 40Million+ Rows
>
>What I need:
>For each "old" locator number, query the table (all three columns) and
>insert "new" locator into empty column.
>
>Question:
>What is the best way to do this?
>Create another table of old to new, and use that to query?
>Single query using OR?
>Multiple passes, one for each column?
>Some slick PL/SQL that I don't know about?
>
>Thanks,
>
>Pete Stryjewski
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World! Check out our new Unlimited Server. No Download or Time Limits! -----== Over 80,000 Newsgroups - 19 Different Servers! ==----- Received on Tue Oct 16 2001 - 15:20:30 CDT
![]() |
![]() |