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 with case statement

Roger25Nov 19 2013 — edited Nov 19 2013

Hi,

I need to do something like this:

update my_table set (prelucrat, err) = (select case

                                                         when r.id is not null then

                                                           ('D', null)

                                                         else

                                                           ('N', 'Nu exista persoana cu marca '||r.marca)

                                                       )

where marca = r.marca and ctiserver = r.ctiserver

But I got a "missing right paranthesis" error.

"r" is a cursor variable, so this update is nested into a "for r in (...) loop".

What I'm doing wrong? Is it possible to update two columns at once and use case in that select?

Thank you.

This post has been answered by Ramin Hashimzadeh on Nov 19 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 17 2013
Added on Nov 19 2013
6 comments
377 views