Search Postgresql Archives

Re: passing parameters to multiple statements

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello

2009/11/16 Konstantin Izmailov <pgfizm@xxxxxxxxx>:
> 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, ...);
>

sorry, it is not direct reply on your question, but why don't you  use
simply stored procedure?

btw. It looks like case for trigger
did you know RETURNING clause?

your code is very cumbrous

Regards
Pavel Stehule

> Thank you!

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux