Обсуждение: ' syntax

Поиск
Список
Период
Сортировка

' syntax

От
amarof
Дата:
hi all
i want to include this character ' in a string like "mystring's" but i
don't know the right syntax for it.
when i want to enter a string in the filter condition like "doctorat
d'etat" , i get this error   parse error near etat.
thanks



Re: [GENERAL] ' syntax

От
"Brett W. McCoy"
Дата:
On Sat, 5 Jun 1999, amarof wrote:

> i want to include this character ' in a string like "mystring's" but i
> don't know the right syntax for it.
> when i want to enter a string in the filter condition like "doctorat
> d'etat" , i get this error   parse error near etat.

Precede the character with a backslash:

mystring\'s
dotorat d\'etat

Brett W. McCoy
                                         http://www.lan2wan.com/~bmccoy
-----------------------------------------------------------------------
Chemistry is applied theology.
        -- Augustus Stanley Owsley III


Re: [GENERAL] ' syntax

От
John Browning
Дата:
> On Sat, 05 Jun 1999 14:49:49 +0000, amarof <amarof@marwan.ac.ma> said:

  > hi all
  > i want to include this character ' in a string like "mystring's" but i
  > don't know the right syntax for it.
  > when i want to enter a string in the filter condition like "doctorat
  > d'etat" , i get this error   parse error near etat.
  > thanks

backslash d\'etat

Re: [GENERAL] ' syntax

От
Herouth Maoz
Дата:
At 21:24 +0300 on 01/06/1999, Brett W. McCoy wrote:


> Precede the character with a backslash:
>
> mystring\'s
> dotorat d\'etat

The standard is doubling the quote:

mystring''s
dorctorat d''etat

Backslashes are specific to PostgreSQL, and I don't recommend them.

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma