Link to home
Start Free TrialLog in
Avatar of matrixrasta
matrixrasta

asked on

How to update multiple columns in a prepared statement

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
Avatar of Gibu George
Gibu George
Flag of India image

preparedstatement pstmt=conn.preparestatement("update table set col1=? where col1=?")
pstmt.setInt(1,3)
pstmt.setInt(2,4)
Avatar of matrixrasta
matrixrasta

ASKER

I guess its with the
update Table set col1=3, col2 = 99, col3=98 where col1 = 4
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
> update Table set col1=3, col2 = 99, col3=98 where col1 = 4

correct :)

Sorry gibu_george
thats not what i wanted, i asked for multiple columns
i just posted the solution on top
Thanks objects: