Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa SQL Syntax error in my UPDATE..please advise

Have Programming Question? Ask it here!
 
 
 


Karen
Syntax error in my UPDATE..please advise
1 Answer(s)      3 years ago
Posted in : SQL


Hi experts,

I tested my code and NetBean IDE gave me the following message:-

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where ID = 2' at line 1 org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:862)

And here's my UPDATE Statement:

String sql = "UPDATE members SET strNRICNO=' " + NRIC
                                + " ', strName=' " + Name + " ', strEmail= ' "
                                + Email + " ', strAddress = ' " + Address + " ',strContact= ' "
                                + Contact + "', strGender = ' " + Gender + "', strRemark =  '"
                                + Remark + "', strAge= '" + Age + "', strQualification= '"
                                + Qualification + "', 
                                + strOccupation ='"
                                + Occupation + "', strSubject= '"
                                + Subject + "', strBudget ='"
                                + Budget + "', where ID = " + selectionId;
                        stmt.executeUpdate(sql);

Please advise how should I change my SQL to use Heidi MySQL.

Tks.


Advertisement
View Answers

July 25, 2011 at 10:56 AM


Here is correct format:

String sql = "UPDATE members SET strNRICNO=' " + NRIC + " ', strName=' " + Name + " ', strEmail= ' " + Email + " ', strAddress = ' " + Address + " ',strContact= ' " + Contact + "', strGender = ' " + Gender + "', strRemark = '" + Remark + "', strAge= '" + Age + "', strQualification= '" + Qualification + "', + strOccupation ='" + Occupation + "', strSubject= '" + Subject + "', strBudget ='" + Budget + "', where ID = " + selectionId+"";
stmt.executeUpdate(sql);


Related Tutorials/Questions & Answers:
Syntax error in my UPDATE..please advise
Syntax error in my UPDATE..please advise  Hi experts, I tested my...; stmt.executeUpdate(sql); Please advise how should I change my SQL to use Heidi MySQL...) And here's my UPDATE Statement: String sql = "UPDATE members SET strNRICNO
sql syntax error help
sql syntax error help  this query show syntax error .. i am unable to figure it out insert into order (orderdate, dpname, paymethod, tamount...') where is the error ?   Please send the error details and the datatype
Advertisements
How to Solve the Syntax Error in java??
How to Solve the Syntax Error in java??  Syntax error in java? i have tried this program its showing error like this in Eclipse "Syntax error... of the program "objectname.i" What is the reason for this error??How to access the variable
syntax error in SQL Insert Statement - Java Beginners
syntax error in SQL Insert Statement  Dear Sir ,I have write following code to save data into access databse, but code gives following error code... Access Driver] Syntax error in INSERT INTO statement. plz Help Me  Hi
syntax error in SQL Insert Statement - Java Beginners
syntax error in SQL Insert Statement   private class ButtonListener implements ActionListener{ public void actionPerformed(ActionEvent ae){ //tab1 if(ae.getSource()==bt1ok){ // String date
I GOT ERROR FOR MY PROJECT
I GOT ERROR FOR MY PROJECT  Dear Friend/ RoseIndia Team, Firstly I would to thank u Guys help me so many time.. I got error on my little project when running at server. please correctly my error Guys... ERROR CODE: "LOGIN
How to Checking Syntax Error in PHP from Command Line
How to Checking Syntax Error in PHP from Command Line  Checking Syntax Error in PHP from Command Line   PHP allows you to check your script.... It will check the syntax error in your script and show the ??Unexpected token
How to resolve this error The filename, directory name, or volume label syntax is incorrect
How to resolve this error The filename, directory name, or volume label syntax... + createTimeStampStr() + ".PNG"; this my program public class Image... getting this error java.io.FileNotFoundException: http:\www.queen.com
My Sql Error - Development process
My Sql Error  Hello Sir ,I have Created Table with following Query,then Table Created Succefully,But some errors Occured, can u give me the Code...,Its Very Very Urgent. Thank u very Much for urs Great Support in My
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.  String sql = "UPDATE emp_details SET empEname = ?, emailId = ?, guid =?, proximityCard =?, managerEmailId = ?, reviewerEmailId
i am unable to identify the error in my code
i am unable to identify the error in my code  class Program { public static void main(String[] args) { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.println("enter
i am unable to identify the error in my code
i am unable to identify the error in my code  class Program { public static void main(String[] args) { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.println("enter
how do i update my database with the help of update syntax in html <text/javascript>? How to write 'where' statement in this?
how do i update my database with the help of update syntax in html ? How to write 'where' statement in this?  var sqlmek="update into Student_info...'); alert('Press OK to Update your Records Successfully
Upgraded MySQL from 5.1 to 5.5, running into PDOException: SQLSTATE[42000]: Syntax error or
Upgraded MySQL from 5.1 to 5.5, running into PDOException: SQLSTATE[42000]: Syntax error or  Upgraded MySQL from 5.1 to 5.5, running into PDOException: SQLSTATE[42000]: Syntax error or
ERROR with my JAVA code - Java Beginners
ERROR with my JAVA code  The error came up in my main method... it wasnt there until i finished my actionListener coding so I dont know how to fix this....it is really stressing me out!! HELP!!! import java.awt.*; import
plz check my codings are correct or not...There is an error..i cant find it..
plz check my codings are correct or not...There is an error..i cant find it..  import java.util.Scanner; public class Student { private String indexNo; private String gender; private char initial; private int mark1
syntax for create a table
syntax for create a table  syntax for create a table
Can someone review my script for an apparent parsing error? -it isn't quite finished yet, but I want to fix error first
Can someone review my script for an apparent parsing error? -it isn't quite finished yet, but I want to fix error first   import java.util.Scanner; class historyquiz{ public static void main(String args
javascript comment syntax html
javascript comment syntax html  javascript comment syntax html
I'm getting an illgal start of expression error in my code for the public static boolean portion at the bottom... any ideas?
I'm getting an illgal start of expression error in my code for the public static boolean portion at the bottom... any ideas?  heres my code import java.util.Scanner; import java.util.Random; public class numberGame
confused about an error in my web application deploying to Tomcat - Java Server Faces Questions
confused about an error in my web application deploying to Tomcat  Could any one please test this application and tell me what's the problem... com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! Error at line 26 char 69: argument type mismatch
Text Editor with Syntax Highlighting
Text Editor with Syntax Highlighting   How to write a java program for text editor with syntax highlighting
php header syntax
php header syntax  What is the correct syntax of PHP Header
JAVA Syntax - Java Beginners
JAVA Syntax  main method syntax in jdk1.3 with one example
Java Syntax - Java Beginners
me why i get an error [List cannot be resolved to a type] when i try to do... my element would be a list? how could i make such a declaration? (p.s.: i... similar on my own...) thank you in advance for any assistance!  
general syntax for a SELECT statements
general syntax for a SELECT statements  Write down the general syntax for a SELECT statements covering all the options   Hi, The general syntax of a select statement covering all the options is as follows, this syntax
php do while syntax
php do while syntax  How to create a do while loop in php. What is the syntax
syntax problem - Java Beginners
syntax problem  Hi , Im loading a particular css class for a specific div id using the syntax shown below.Please tell me what is the syntax if i have to perform a "not equal to check" fo the class name mentioned below
error
/ServletUserEnquiryForm.shtml getting an error given below SQLException caught: [Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error please suggest
error
error  i have 404 error in my program plz tell me yhe solution about
error
error  i have 404 error in my program plz tell me yhe solution about
Java Syntax - Java Beginners
me why i get an error [List cannot be resolved to a type] when i try to do... my element would be a list? how could i make such a declaration? (p.s.: i... similar on my own...) thank you in advance for any assistance!  
Syntax of code in HTML5.
The Use of SVG and MathML Syntax of code in HTML5. HTML5 defines an HTML syntax compatible with HTML4 and XHTML1 documents but not compatible.... The documents that use HTML syntax are almost always served with the text/html
What is the syntax for a CREATE TABLE statement?
What is the syntax for a CREATE TABLE statement?  What is the syntax for a CREATE TABLE statement
PHP Code Syntax
PHP Code Syntax PHP syntax is the set of rules which need to be followed to to write properly structured PHP code. Given below Some rules of PHP syntax...; <title>My First PHP Page</title> </head> <body> <
error
error  while iam compiling iam getting expected error
Error-
Error-   Hello, I would like to know about XSD file. I try to print XML file but I am getting error SAXException-- says Content is not allowed in prolog. Please help me
JSP page directive tag syntax
JSP page directive tag syntax  Descibe the syntax of the page directive with example In JSP.   Hi, The JSP page directive tag syntax is: <%@ page attributeName="values" %> The JSP page directive tag
Objective C if else statements syntax
Objective C if else statements syntax  What is the syntax of if else statements in Objective C?   Using of if else statement in Objective C There is no changes in the syntax format of if else statement. You can write
error
"+it); } } this is my program i am getting an error saying cannot find symbol class string
Error
state then city will not come in dropdown list and it give me error as 'Unknown Runtime Error'. This error come only in IE browser, but in other brower it shows me proper output. Please anybosy can give me remedy on that..... Thank you
session syntax for logout - JSP-Servlet
session syntax for logout  What is the syntax for writing session for logout page in login services ?  Hi friend<%@page import="java.util.*" %><%session.invalidate();%>You have logout. Please try
error
error
error
error  java.lang.unsupportedclassversionerror:bad major version at offset 6 how to solve this????   Hi, Please check the version of framework used and also the JDK version. This type error also comes when java file
error
error  When I deploye the example I have this message cannot Deploy HelloWorld Deployment Error for module: HelloWorld: Error occurred during...://java.sun.com/xml/ns/javaee'.. Please see server.log for more details. please help me
error!!!!!!!!!
error!!!!!!!!!   st=con.createStatement(); int a=Integer.parseInt(txttrno.getText()); String b=txttname.getText(); String c=txtfrom.getText(); String d=txtto.getText
error!!!!!!!!!
error!!!!!!!!!   st=con.createStatement(); int a=Integer.parseInt(txttrno.getText()); String b=txttname.getText(); String c=txtfrom.getText(); String d=txtto.getText
error!!!!!!!!!
error!!!!!!!!!   st=con.createStatement(); int a=Integer.parseInt(txttrno.getText()); String b=txttname.getText(); String c=txtfrom.getText(); String d=txtto.getText
error
is"+sum); } } this is my program i need to print the series (1+2/12)+(1+2
Error
Error  Hi. I am getting error in the following code after the line I have commented as ERROR. How to solve this. Thanks in advance. package...=='')"); out.println(" {"); out.println(" alert('Please enter
 

 

 

DMCA.com