?
Solved

How to update multiple columns in a prepared statement

Posted on 2009-04-29
7
Medium Priority
?
541 Views
Last Modified: 2012-08-14
Dear Experts

Can some one give me a sample syntax on how to update multiple columns.

What I know:
update Table set col1=3 where col1 = 4
0
Comment
Question by:matrixrasta
  • 3
  • 3
7 Comments
 
LVL 12

Expert Comment

by:Gibu George
ID: 24258557
preparedstatement pstmt=conn.preparestatement("update table set col1=? where col1=?")
pstmt.setInt(1,3)
pstmt.setInt(2,4)
0
 

Author Comment

by:matrixrasta
ID: 24258559
I guess its with the
update Table set col1=3, col2 = 99, col3=98 where col1 = 4
0
 
LVL 92

Accepted Solution

by:
objects earned 1000 total points
ID: 24258560
update Table set col1=3, col2='abc' where col1 = 4

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 92

Expert Comment

by:objects
ID: 24258561
> update Table set col1=3, col2 = 99, col3=98 where col1 = 4

correct :)

0
 
LVL 92

Expert Comment

by:objects
ID: 24258565
0
 

Author Comment

by:matrixrasta
ID: 24258568
Sorry gibu_george
thats not what i wanted, i asked for multiple columns
i just posted the solution on top
0
 

Author Comment

by:matrixrasta
ID: 24258573
Thanks objects:
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses
Course of the Month14 days, 2 hours left to enroll

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question