leaving out paramTypes parameter

Поиск
Список
Период
Сортировка
От Andro
Тема leaving out paramTypes parameter
Дата
Msg-id da7021e0608140638w4bc5a22ey4d358d649442c8f5@mail.gmail.com
обсуждение исходный текст
Ответы Re: leaving out paramTypes parameter  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-interfaces
Hi,

from the documentation, here's PQexecParams prototype

PGresult *PQexecParams(PGconn *conn,                      const char *command,                      int nParams,
             const Oid *paramTypes,                      const char * const *paramValues,                      const
int*paramLengths,                      const int *paramFormats,                      int resultFormat);
 

and PQprepare's

PGresult *PQprepare(PGconn *conn,                   const char *stmtName,                   const char *query,
        int nParams,                   const Oid *paramTypes);
 

they both require "paramTypes" parameter, but documentation says "If
paramTypes is NULL, or any particular element in the array is zero,
the server assigns a data type to the parameter symbol in the same way
it would do for an untyped literal string."

How reliable is that? Can we really leave out this parameter anytime?
What are known issues? Or should we try at all costs to specify
parameters type?

Thanks

Charles


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

Предыдущее
От: Georgi Kolev
Дата:
Сообщение: Re: PQoidValue - get last ID of primary key after INSERT - small
Следующее
От: Tom Lane
Дата:
Сообщение: Re: leaving out paramTypes parameter