473,385 Members | 1,396 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Apostrophe

OuTCasT
374 256MB
Can anyone tell me why an word with an apostrophe cannot be saved to the db?

i get this error

Incorrect syntax near 's'.
Unclosed quotation mark after the character string ')'.

got some textboxes on a web form. and i encountered this error when i tried to save for example, sweet's ??

is there a solution for it ?
Apr 16 '08 #1
4 2145
ck9663
2,878 Expert 2GB
Can anyone tell me why an word with an apostrophe cannot be saved to the db?

i get this error

Incorrect syntax near 's'.
Unclosed quotation mark after the character string ')'.

got some textboxes on a web form. and i encountered this error when i tried to save for example, sweet's ??

is there a solution for it ?

Because a single quote is signifies string constant. If you want it stored that way, you might want to handle that. Depending on your requirement, you can either replace it with '' (two single quotes) or a double quote ("). If you're doing the double quote, you have to handle it back to a (one) single quote when you retrieve it back for your front-end.

Happy Coding.

-- CK
Apr 16 '08 #2
OuTCasT
374 256MB
Because a single quote is signifies string constant. If you want it stored that way, you might want to handle that. Depending on your requirement, you can either replace it with '' (two single quotes) or a double quote ("). If you're doing the double quote, you have to handle it back to a (one) single quote when you retrieve it back for your front-end.

Happy Coding.

-- CK
I did read about that -- CK
replace ("" ' "") or something like that.

things can never just be straight forward now can they.
Apr 17 '08 #3
amitpatel66
2,367 Expert 2GB
I did read about that -- CK
replace ("" ' "") or something like that.

things can never just be straight forward now can they.
Why are you not able to replace a single quote with a two single quotes

Check this:

Expand|Select|Wrap|Line Numbers
  1.  
  2.   1* SELECT REPLACE('Your''s','''','''')
  3. SQL> /
  4.  
  5. REPLAC
  6. ------
  7. Your's
  8.  
  9. SQL> ed
  10. Wrote file afiedt.buf
  11.  
  12.   1* SELECT REPLACE('Your''s','''','''''')
  13. SQL> /
  14.  
  15. REPLACE
  16. -------
  17. Your''s
  18.  
  19. SQL> 
  20.  
  21.  
Apr 17 '08 #4
ck9663
2,878 Expert 2GB
I did read about that -- CK
replace ("" ' "") or something like that.

things can never just be straight forward now can they.
Yep.

The more they things get simple, the more they get complicated ;)

-- CK
Apr 17 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Meyer1228 | last post by:
You all helped me with function keys last week. Thanks so much; your advice was right on. My question now - does anyone have a function that I can use to test my sql statements for the...
2
by: Michael Sterling | last post by:
i'm using delphi 7 and have a query in which i'm trying to find names that have an apostrophe in them, i.e. "o'mally". my problem is that when i write my select statement i can't get the quotes...
2
by: InvisibleMan | last post by:
Thank in advance for your help... I have the following javascript: document.write(' <a class="whitenav" href="javascript:window.external.AddFavorite ('http://www.mydomain.com','Welcome to...
13
by: Richard Hollenbeck | last post by:
To prevent future apostrophe bugs and errors, isn't it just simpler to forbid an apostrophe from being entered into a text field? For example, couldn't "Alice's Restaurant" be changed to "Alices...
1
by: congngo | last post by:
Hi all Every time I export a table into an excel spreadsheet. It has a leading apostrophe on every cells. This drive me nut. I have to do a work around by export table into a txt file than...
1
by: spacehopper_man | last post by:
hi - I am having "apostrophe in sql" problems ;) I am executing a stored procedure on SQL Server - and passing in a string parameter. the string has a single apostrophe in it. the call...
1
by: Rose | last post by:
Hi all, I'm trying to create a clickable link, but the pesky apostrophe is preventing the link from getting displayed properly. I'm displaying the contents of a folder (with contains the...
2
by: Tom | last post by:
Hi, I have some kind of problems with an apostrophe character ('). I would like to select from DataTable DataRow containing value horses' (with an apostrophe on the end). But when I do it in an...
9
by: Thomas 'PointedEars' Lahn | last post by:
Jukka K. Korpela wrote: IBTD. For example, in English it is customary (and AIUI expected) to use the character that ’ represents should be used to delimit a quotation within direct speech...
4
by: Razzbar | last post by:
I'm working on a bookmarklet that grabs information from a page and submits it to a server. Yet another social bookmarking application. I'm having trouble with page titles that include an...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.