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!

SQL command for UPDATE of multiple rows

user8819407Dec 21 2009 — edited Dec 21 2009
Hi,
how to write SQL command to updating multiple rows in one statement? I tried as follows from TOAD which worked:

UPDATE TableA SET a = 'x' WHERE b = 'a';
UPDATE TableA SET a = 'x' WHERE b = 'b;
UPDATE TableA SET a = 'x' WHERE b = 'c';
UPDATE TableA SET a = 'x' WHERE b = 'd';
...

But when I created same command and runned it from my asp.net (C#) application it didn't work, how come? It cause an ORA-00911: invalid character problem.

My solution now is that I create one update command, insert into database, create next update command, insert into database, and so weither. This creates a lot of pressure on the server I guess and couldn't be the most effective way to write/run this update query.

Any ideas/recommendations how to solve above is highly appreciated.

Thx in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 18 2010
Added on Dec 21 2009
9 comments
9,909 views