Search Postgresql Archives

Re: accessing PG using Perl:DBI

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

 




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.


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

[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