Re: How to insert a string with single quotes in the text

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: How to insert a string with single quotes in the text
Дата
Msg-id 20030920173847.GA17807@wolff.to
обсуждение исходный текст
Ответ на How to insert a string with single quotes in the text  ("Louise Cofield" <lcofield@box-works.com>)
Список pgsql-interfaces
On Fri, Sep 19, 2003 at 15:02:07 -0600, Louise Cofield <lcofield@box-works.com> wrote:
> 
> I am creating a Libpq program that reads a text file, and inserts values
> into a Postgres table.  An example of my insert statement looks like
> this:
> 
> SPRINTF(str, "INSERT INTO itm_table (itm_num, itm_desc) values ('%s',
> '%s');", sitmnum, sitmdesc);
> 
> Other than stripping the offending quote-marks from  the text prior to
> processing, does anybody have any ideas how I can deal with this?

Scan the input and put backslashes in front of backslashes and single quotes.


В списке pgsql-interfaces по дате отправления:

Предыдущее
От: Mayank Goyal
Дата:
Сообщение: Need information for C++ interface
Следующее
От: "Michael Palmer"
Дата:
Сообщение: ...