Problem with apostrophe

Started by Nonamealmost 28 years ago7 messagesgeneral
Jump to latest
#1Noname
eric@gateway.ctlno.com

Is there any way of having an apostrophe in a data field?
It is a problem because the apostrophe is the same character as the single
quote, so the database gets a parser error when a name such as "O'Brian"
is entered.

There must be a work-around, but I can not find any solution.

thank you for your help

#2Amos Hayes
ahayes@ingenia.com
In reply to: Noname (#1)
Re: [GENERAL] Problem with apostrophe

On Wed, 17 Jun 1998 eric@gateway.ctlno.com wrote:

Is there any way of having an apostrophe in a data field?
It is a problem because the apostrophe is the same character as the single
quote, so the database gets a parser error when a name such as "O'Brian"
is entered.

Have you tried doubling up? 'O''Brian'

That is what I have to do in Oracle anyway.

--
Amos Hayes Systems Architect
ahayes@ingenia.com Ingenia Group - Software Kinetics Ltd.
http://smurf.ingenia.com/~ahayes http://www.ingenia.com

"Remember: No one can make you feel inferior without your consent."
- ELEANOR ROOSEVELT

#3Noname
eric@gateway.ctlno.com
In reply to: Amos Hayes (#2)
Re: [GENERAL] Problem with apostrophe

the escape character brings up the help menu, thinking that \' is not a
valid option.

On Wed, 17 Jun 1998, Brett W. McCoy wrote:

Show quoted text

On Wed, 17 Jun 1998, Amos Hayes wrote:

Is there any way of having an apostrophe in a data field?
It is a problem because the apostrophe is the same character as the single
quote, so the database gets a parser error when a name such as "O'Brian"
is entered.

Have you tried doubling up? 'O''Brian'

That is what I have to do in Oracle anyway.

Isn't there an escape character, like the slash?

Brett W. McCoy
http://www.lan2wan.com/~bmccoy
-----------------------------------------------------------------------
"The Number of UNIX installations has grown to 10, with more expected."
-- The UNIX Programmer's Manual, 2nd Edition, June, 1972

#4Byron Nikolaidis
byronn@insightdist.com
In reply to: Noname (#1)
Re: [GENERAL] Problem with apostrophe

Just escape the apostrophe with a backslash.

Byron

eric@gateway.ctlno.com wrote:

Show quoted text

Is there any way of having an apostrophe in a data field?
It is a problem because the apostrophe is the same character as the single
quote, so the database gets a parser error when a name such as "O'Brian"
is entered.

There must be a work-around, but I can not find any solution.

thank you for your help

#5Brett W. McCoy
bmccoy@lan2wan.com
In reply to: Amos Hayes (#2)
Re: [GENERAL] Problem with apostrophe

On Wed, 17 Jun 1998, Amos Hayes wrote:

Is there any way of having an apostrophe in a data field?
It is a problem because the apostrophe is the same character as the single
quote, so the database gets a parser error when a name such as "O'Brian"
is entered.

Have you tried doubling up? 'O''Brian'

That is what I have to do in Oracle anyway.

Isn't there an escape character, like the slash?

Brett W. McCoy
http://www.lan2wan.com/~bmccoy
-----------------------------------------------------------------------
"The Number of UNIX installations has grown to 10, with more expected."
-- The UNIX Programmer's Manual, 2nd Edition, June, 1972

#6Christoph Lorenz
ChLorenz@csi.com
In reply to: Noname (#3)
Re: [GENERAL] Problem with apostrophe

eric@gateway.ctlno.com writes:

the escape character brings up the help menu, thinking that \' is not a
valid option.

No.
Entering something like

SELECT * FROM foo WHERE name=�O\�Brian�;

definitely works.

Ciao
Christoph
--
** http://ourworld.compuserve.com/homepages/ChLorenz/ ** ChLorenz@csi.com **
** No Spam ! ** No Adverts ! ** No Junk-Mails ! ** No unwanted Mails ! **

#7Sferacarta Software
sferac@bo.nettuno.it
In reply to: Noname (#1)
Re: [GENERAL] Problem with apostrophe

On Wed, 17 Jun 1998 eric@gateway.ctlno.com wrote:

Is there any way of having an apostrophe in a data field?
It is a problem because the apostrophe is the same character as the single
quote, so the database gets a parser error when a name such as "O'Brian"
is entered.

There must be a work-around, but I can not find any solution.

thank you for your help

You may use doubble apostrophe as in O''Brian to match O'Brian this is
SQL92.
Jose'
| |
~~~~~~~~~~~~~~~~~~~~~~~~ | | ~~~~~~~~~~~~~~~~~~~~~~~~
Progetto HYGEA ---- ---- www.sferacarta.com
Sfera Carta Software ---- ---- sferac@bo.nettuno.it
Via Bazzanese, 69 | | Fax. ++39 51 6131537
Casalecchio R.(BO) Italy | | Tel. ++39 51 591054
-----------------------------------------------------------------------------