Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Oracle mass update script request.

by grinder (Bishop)
on Jul 28, 2008 at 10:21 UTC ( #700495=note: print w/replies, xml ) Need Help??


in reply to Oracle mass update script request.

Why do you want to make life so miserable for yourself? Why not ask the database to do the update for you in one hit.

update table1 t1 set t1.field1 = 999 where exists ( select 1 from table2 t2 where t1.id = t2.id )

Then you just have to debug your SQL. No Perl needed apart from a $db->do(''), no bugs to look for! Not to mention faster...

• another intruder with the mooring in the heart of the Perl

Replies are listed 'Best First'.
Re^2: Oracle mass update script request.
by dbmathis (Scribe) on Jul 28, 2008 at 12:08 UTC
    grinder,

    I must be missing something. Are you saying I can update 45000 records all at once? Were does the sql get the 45000 records from when they only exist in a flat text file?

    I agree that the easiest solution is always the best solution. Can you please elaborate?

    Best Regards

    After all this is over, all that will really have mattered is how we treated each other.
        Makes sense. Thanks.

        After all this is over, all that will really have mattered is how we treated each other.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://700495]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2022-05-24 18:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (84 votes). Check out past polls.

    Notices?