Re: Pg.pm oddity with apostrophes
| От | Anthony E . Greene |
|---|---|
| Тема | Re: Pg.pm oddity with apostrophes |
| Дата | |
| Msg-id | 20000826203353.C4094@cp5340 обсуждение исходный текст |
| Ответ на | Pg.pm oddity with apostrophes (Charles Curley <ccurley@trib.com>) |
| Ответы |
Re: Pg.pm oddity with apostrophes
|
| Список | pgsql-novice |
On 26 Aug 2000 12:42 Charles Curley wrote:
>The oddity I have hit is that if I try to inset a name with an apostrophe
>in it (e.g. O'Neil), pgsql belly-aches and returns an error of 7. The
>record is not inserted.
Perl will escape the apostrophe and will not pass the backslash on to the
backend. You will need to use a double backslash:
$sql = "INSERT INTO contacts VALUES ('Mr.','Patrick','O\\'Neil','http://URL')";
Tony
--
Anthony E. Greene <agreene@pobox.com> <http://www.pobox.com/~agreene/>
PGP Key: 0x6C94239D/7B3D BD7D 7D91 1B44 BA26 C484 A42A 60DD 6C94 239D
Linux. The choice of a GNU Generation. <http://www.linux.org/>
В списке pgsql-novice по дате отправления: