Re: passing parameters to multiple statements

Поиск
Список
Период
Сортировка
Искать
От
Konstantin Izmailov
Тема
Re: passing parameters to multiple statements
Дата
Msg-id
72746b5e0911170833j7e48f8b1r9921e5a0bb3f98f6@mail.gmail.com
Ответ на
Re: passing parameters to multiple statements (manitou-sig@sd-9404.dedibox.fr)
Список
Дерево обсуждения
passing parameters to multiple statements Konstantin Izmailov <pgfizm@gmail.com>
Re: passing parameters to multiple statements Pavel Stehule <pavel.stehule@gmail.com>
Re: passing parameters to multiple statements manitou-sig@sd-9404.dedibox.fr
Re: passing parameters to multiple statements Konstantin Izmailov <pgfizm@gmail.com>
Re: passing parameters to multiple statements David Fetter <david@fetter.org>
Re: passing parameters to multiple statements Ivan Sergio Borgonovo <mail@webthatworks.it>
Re: passing parameters to multiple statements Pavel Stehule <pavel.stehule@gmail.com>
Re: passing parameters to multiple statements Ivan Sergio Borgonovo <mail@webthatworks.it>
Re: passing parameters to multiple statements Pavel Stehule <pavel.stehule@gmail.com>
advocating pgsql was:passing parameters to multiple statements Ivan Sergio Borgonovo <mail@webthatworks.it>
Re: passing parameters to multiple statements Konstantin Izmailov <pgfizm@gmail.com>
Re: passing parameters to multiple statements Pavel Stehule <pavel.stehule@gmail.com>
Re: passing parameters to multiple statements "Daniel Verite" <daniel@manitou-mail.org>
Re: passing parameters to multiple statements Thomas Kellerer <spam_eater@gmx.net>
Some companies have policy to stay DB agnostic, i.e. use standard SQL only. This is why they want to use multiple statements, not stored procedures.
 
I'm not familiar with RETURNING. Is this SQL standard? Can it be used for inserting a row and returning back primary key for the inserted row in one statement?
 
If PQexecParams does not support multiple statements, it needs to be extended for the support, or new function created for the purpose. If I do the change in libpq, may I submit the code to community?
 
Thank you!
Konstantin

On Mon, Nov 16, 2009 at 2:11 PM, <manitou-sig@sd-9404.dedibox.fr> wrote:
       Konstantin Izmailov wrote:

> I'm planning to use multiple statements via libpq. Before starting coding
> I'm trying to understand are there any limitations on passing parameters.
> E.g. would the following work:
>   PQexecParams(conn, "BEGIN;INSERT INTO tbl VALUES($1,$2);SELECT
> lastval();SELECT * INTO AUDIT FROM (SELECT $3, 'tbl action',
> lastval());COMMIT;", 3, ...);

No, because PQexecParams doesn't accept multiple SQL statements.

Best regards,
--
Daniel
PostgreSQL-powered mail user agent and storage: http://www.manitou-mail.org

В списке pgsql-general по дате отправления
От: Geoffrey
Дата:
Сообщение: Re: WAL file question
От: Ivan Sergio Borgonovo
Дата:
FAQ