The keyword AND is not used in this context. You should use:
update extest set qno = ?, answer = ? where ...

Good luck,
amir


>
> Hello all,
>
>         I need to update 2 values simulatenously into a
> database having
>         the basevalue as the name of the user.
>
>         Say if i have user field and i have to update 2 values for him
>         one is his age and another one is his sex.
>
>         when i say i preparedstatement the following
>
>         PreparedStatement stmt = con.prepareStatement("UPDATE
> extest " +
>                                  "set qno = ? where Name like ?");
>
>         it is working perfect i am just updating only 1
> statement but when
>         i used two values say
>
>         PreparedStatement stmt = con.prepareStatement("UPDATE
> extest "+
>                          "set qno = ? And answer = ? where
> Name like ?");
>         it is giving me the following error
>
>         Error:
>         ======
>         [Microsoft][ODBC SQL Server Driver][SQL
> Server]Incorrect syntax
>         near the keyword 'AND'.  I am very new to this SQL part pls
>         help me.
>
>
> Thanks for ur help,
> Srini
>
> ______________________________________________________________
> _____________
> To unsubscribe, send email to [EMAIL PROTECTED] and
> include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources:
http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to