Re: accessing PG using Perl:DBI

Поиск
Список
Период
Сортировка
От Vivek Khera
Тема Re: accessing PG using Perl:DBI
Дата
Msg-id 23652D25-9D2E-441A-8564-9B25A060B9CA@khera.org
обсуждение исходный текст
Ответ на accessing PG using Perl:DBI  (Ow Mun Heng <Ow.Mun.Heng@wdc.com>)
Список pgsql-general
On Aug 30, 2007, at 4:03 AM, Ow Mun Heng wrote:

> 2. how do I perform a list of SQL using transactions. eg: like above,
> but wrap it into a transaction.

assuming $dbh is your open handle to the database via DBI, then you
do something like this:

$dbh->begin_work() or die;
$sth = $dbh->prepare(...) or die;
$sth->execute(....) or die;

... more queries as needed...

$dbh->commit() or die;

Did you read the DBI manuals at all?  It has examples.


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: why does a system catalog insert/update/delete not fire a trigger?
Следующее
От: Madison Kelly
Дата:
Сообщение: Select question