Results 1 to 4 of 4

Thread: update querry

  1. #1
    Join Date
    Feb 2012
    Posts
    5

    Unanswered: update querry

    rs1=db.updateSQL("update DB.LOGIN set PASSWORD='"+newp1+"' where USERNAME='"+user+"')");

    This code shows me an error of

    Throwable occurred: com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: );ere USERNAME='raghu';END-OF-STATEMENT

    i know that there exists a problem in query

    could any one correct the "query" i know that there exists a problem in query

    Thanks in advance

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    1 x (
    2 x )
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  3. #3
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    I hope you verify that the variables newp1 and user will not contain anything like a ' or ; or some other character, which changes the SQL statement. That would be a classic SQL injection problem otherwise.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  4. #4
    Join Date
    Jul 2009
    Location
    NY
    Posts
    963

    Talking extra ")"

    Quote Originally Posted by raghuramgrr View Post
    rs1=db.updateSQL("update DB.LOGIN set PASSWORD='"+newp1+"' where USERNAME='"+user+"')");

    This code shows me an error of

    Throwable occurred: com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: );ere USERNAME='raghu';END-OF-STATEMENT

    i know that there exists a problem in query

    could any one correct the "query" i know that there exists a problem in query

    Thanks in advance
    You made the syntax error and message shown this error to you.

    Has to be:

    Code:
    rs1=db.updateSQL("update DB.LOGIN set PASSWORD='"+newp1+"' where USERNAME='"+user+"'");
    Lenny

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •