Re: [GENERAL] accessing PG using Perl:DBI

2007-08-30 Thread SCassidy
see the perldoc documentation for a more robust example): $dbh->{AutoCommit} = 0; #assuming that AutoCommit was previously set to 1 $sth = $dbh->prepare("INSERT INTO test3(nameval, boolval) VALUES (?, ?)"); foreach my $nm ('Joe', 'Fred', 'Sam') {

Re: [GENERAL] accessing PG using Perl:DBI

2007-08-30 Thread Vivek Khera
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

[GENERAL] accessing PG using Perl:DBI

2007-08-30 Thread Ow Mun Heng
Hi all, I'm sure some of you guys do perl-dbi to access perl. need some pointers. (pg specific I guess) 1. Possible to execute queries to PG using multiple statemments? eg: prepare("A") bind_param($A) execute() prepare("BB") bind_param($B) execute() prepare("CC") bind_param($B) execute() right