help with multi-update


Posted on 16th Feb 2014 07:03 pm by admin

Now sure how to ask this really....
10g database if that matters.

I have a customer that accidently changed 742 records incorrectly. I'm being asked to fix it.

Here is the sql that SHOWS me the relevant columns...

Select
p2.numberprgn,
a.agreement_id,
p2.ng_legacy_agreement_id
from
msp_sc.probsummarym1 p, msp_sc.probsummarym2 p2, msp_sc.ngslaassistm1 a
where
p.NUMBERPRGN = p2.NUMBERPRGN and
a.ORG_LEVEL1 = p.NG_SECTOR_NM and
a.CURRENT_ASSIGN_GROUP = p.ASSIGNMENT and
a.SEVERITY = p.SEVERITY_CODE and
p.OPEN_TIME >= '1-AUG-09' AND
p.OPEN_TIME <= '21-OCT-09' and
P.CATEGORY = 'USER-DESKTOP' and
p2.ng_legacy_agreement_id = '379' and
p2.ng_legacy_agreement_id <> a.agreement_id;

When I ran a distinct query against the agreement id, I get a total of 7 id's.

361
352
356
358
350
348
360

So I need to change the legacy ids to match the respective agreement id.

I know how to do it on a one by one basis...but there has to be a better way than doing that 742 times.

example:
NUMBERPRGN AGREEMENT_ID NG_LEGACY_AGREEMENT_ID
IM2108605 356 379
IM2113059 356 379
IM2116625 356 379
IM2117250 356 379
IM2119411 356 379
How do I go about this?

thx

No comments posted yet

Your Answer:

Login to answer
75 Like 30 Dislike
Previous forums Next forums
Other forums

Give me all your tricks for minimizing jar file size

Hi, I'm coming close to releasing my J2ME game... I am kicking up against the 64k size barrier w

Php If in MySql query (hiding labels if a field is empty)
Okay, I've been trying to do this for a while, and I'm finally going to ask for help so I can get th

Problem with HTML form
Hello,

I made a HTML form with some fields and check box.
Everything works fine except whe

database design
Hi,

I got a page which allow candidate to type in their previous working experience,
I let

Data type mismatch
Hi,
I am migrating data from algol to c.I mapped real datatype in algol to double datatype in

storing video files into mysql in php
hi

i have my video files in my folder ,
i have to store the path of the videos into db an

unexpected T_STRING
error log "[Sat Jan 09 18:27:58 2010] [error] [client 127.0.0.1] PHP Parse error: syntax error

Multidimensional array problems in $_POST
I'm having trouble with a three-dimensional $_POST array. It starts as a two-dimensional array on th

Need help with unexpected T-STRING error
I'm a newbie and I'm still learning PHP. However this error has me stumped. I've googled, searched t

Help with PHP and checkboxes
I am posting this for a friend of mine, i wrote a small script for her to process her form data to a

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash