Solved

ERROR: parser: parse error at or near "re"

Posted on 2001-08-26
2
208 Views
Last Modified: 2010-05-18
hi Experts,

I've an update statement that does - update scene set text = 'You're right' where id = 196 and ref = 10017;

My sql statement:
sql = "update scene set text = '"+c_text+"' where id = "+c_id+" and ref = "+c_ref+";";

My error:
ERROR: parser: parse error at or near "re"

Please offer ur suggestions on how should I update a text with a ' symbol in my word - You're. Thanks.

Dawn.


0
Comment
Question by:Dawn_rico
  • 2
2 Comments
 
LVL 6

Expert Comment

by:kotan
ID: 6427610
try to update in this method,

sql = "update scene set text = ? where id = " + ...

PreparedStatement pstmt = con.preparedStatement(sql);
pstmt.setString("You're right");

0
 
LVL 6

Accepted Solution

by:
kotan earned 20 total points
ID: 6427613
Sorry!

pstmt.setString("You're right");

should be

pstmt.setString(1, "You're right");
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

777 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