Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Update Multiple Rows with Different values.

Ram venuApr 25 2020 — edited Apr 26 2020

Hi

I have to update descrip column in customer table around 1000 values manually, i.e I have to manually get the 1000 values of descrip values from BA's and update in descrip column, we do not have any source to get these 1000 values

below query i written to done the job,

Can you guys please suggest best way to this 

MERGE INTO  customer cust

USING ( select case when customer_id=1 then 'descrip1'

                    when customer_id=2 then 'descrip2'

                    -

                    -

                    -

                    -

                    1000 end

        from customer cust1

      )  src

ON    (dst.customer_id  = src.customer_id and dst.descrip is null)

WHEN MATCHED THEN UPDATE

SET   dst.descrip  = src.descrip

;

Comments
Post Details
Added on Apr 25 2020
7 comments
10,390 views