Re: PQexec(), what should I do for the "NULL in command" problem?

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: PQexec(), what should I do for the "NULL in command" problem?
Дата
Msg-id 20071112151338.GB13476@svana.org
обсуждение исходный текст
Ответ на PQexec(), what should I do for the "NULL in command" problem?  (jason <zhyuyang@gmail.com>)
Ответы Re: PQexec(), what should I do for the "NULL in command" problem?
Список pgsql-general
On Thu, Nov 08, 2007 at 06:39:23PM -0800, jason wrote:
> As you know the interface of PQexec():
> PGresult *PQexec(PGconn *conn, const char *command);
>
> "command" contains  some SQL statements.
>
> But there exist "\0" in some data filed, and I found PQexec() failed
> on such situation.

Two ways:
- out of line parameters
- escape the nulls, like \0

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Those who make peaceful revolution impossible will make violent revolution inevitable.
>  -- John F Kennedy

Вложения

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

Предыдущее
От: Edoardo Panfili
Дата:
Сообщение: Re: float to int
Следующее
От: "Scott Marlowe"
Дата:
Сообщение: Re: Linux v.s. Mac OS-X Performance