This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Query for multiple updations in a table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Query for multiple updations in a table" Watch "Query for multiple updations in a table" New topic
Author

Query for multiple updations in a table

sunita shaw
Ranch Hand

Joined: Apr 06, 2003
Posts: 45
UPDATE Ruby SET `eprodstatus` = 'InActive' where `vSKU` = '127712' , '127713' , 127714';

I want to set the word "Inactive" in 3 of the rows to the field with vsku= '127712' , '127713' and 127714';
My above query does not work.What is the query for making multiple updation to a column
Kindly let me know urgently as I have a release and I am stuck!!!
Maximilian Xavier Stocker
Ranch Hand

Joined: Sep 20, 2005
Posts: 381
Use OR in your WHERE clause...

The ending query should look like


[ December 02, 2005: Message edited by: Maximilian Stocker ]
Mahesh Rana
Ranch Hand

Joined: Sep 05, 2001
Posts: 139
UPDATE Ruby SET eprodstatus = 'InActive'
WHERE vSKU IN ( '127712' , '127713' , 127714');


SCJP2
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Query for multiple updations in a table
 
It's not a secret anymore!