[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


jdbc single quote problem ( how to escape)

Posted on 2004-11-09
Medium Priority
Last Modified: 2008-01-09
Hi ,
I have a Store Precodure wich takes a varchar input parameters .
I am passing a String like   '20' enquoted in the double quotes like this.
exec sp_GetSearchedDeals @Country = " '09' " .
This Statement works from the DB ( I am using Rapid SQL) . But in my java Program it gives a exception like this

ERROR:com.sybase.jdbc2.jdbc.SybSQLException: Invalid column name ''09''.
I have to pass the single quotes in my String ( the varchar I am passing to the Store Procedure ) . How can i escape the single quotes inside the varchar data i am passing ?
Any help will be greatly appreciated..
Question by:moonoo
1 Comment
LVL 24

Accepted Solution

Joe Woodhouse earned 750 total points
ID: 12542655
You can indicate nested quotes with a part of quotes for the inner set, i.e.

exec sp_GetSearchedDeals @Country = '''09'''

(that's 3 single quotes).

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Applications for our next round of the Experts Exchange Scholarship Contest are starting to roll in. It made us wonder what our past winners are up to these days. Here's a look at what four winners experienced with the contest and what they're doing…
Last month Marc Laliberte, WatchGuard’s Senior Threat Analyst, contributed reviewed the three major email authentication anti-phishing technology standards: SPF, DKIM, and DMARC. Learn more in part 2 of the series originally posted in Cyber Defense …
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

872 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