Re: passing parameters to multiple statements

From: manitou-sig(at)sd-9404(dot)dedibox(dot)fr
To: "Konstantin Izmailov" <pgfizm(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: passing parameters to multiple statements
Date: 2009-11-16 21:11:47
Message-ID: b4496f92-de38-49ef-b516-3d948b3e4472@mm
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dann Corbit 2009-11-16 22:21:27 Re: Update on Insert
Previous Message Andreas Kretschmer 2009-11-16 20:53:42 Re: Update on Insert