Solved

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

Posted on 2001-08-26
2
203 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This video teaches viewers about errors in exception handling.

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now