Executing sproc containing multiple inserts and commits with Perl DBI
From: Femi (femibyte_at_gmail.com)
Date: 01/28/05
- Next message: Michael A Chase: "Re: CAN-2005-0077"
- Previous message: Spiraquis Alexis: "Special characters"
- Next in thread: femibyte1: "Re: Executing sproc containing multiple inserts and commits with Perl DBI"
- Reply: femibyte1: "Re: Executing sproc containing multiple inserts and commits with Perl DBI"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 28 Jan 2005 12:36:42 -0800
Hi all, I inherited an sproc which contains multiple insert statements
followed by subsequent commits.
I have the problem that when I execute this sproc using the Perl DBI
library it only seems to execute the first statement and not the
others.
The sproc looks like this :
begin
...
insert into table A
<dataset 1>
commit transaction
insert into table A
<dataset2>
commit transaction
insert into table A
<dataset3>
commit transaction
end
Unfortunately, only dataset1 gets inserted, not dataset2 or dataset3
into the table.
My DBI code looks like this:
my $dbh = DBI->connect($dsn, $dbUser, $dbPwd);
my $sth;
...
my $qry = qq{exec $sprocName \@arg1=$val1, \@arg2=$val2};
$sth=$dbh->prepare($qry);
$sth->execute() or die "Can't Execute" . $sth->errstr();
do {
while (@row = $sth->fetchrow_array)
{
print "@row\n";
}
} while ($sth->{syb_more_results});
Ideas anyone?
Femi
- Next message: Michael A Chase: "Re: CAN-2005-0077"
- Previous message: Spiraquis Alexis: "Special characters"
- Next in thread: femibyte1: "Re: Executing sproc containing multiple inserts and commits with Perl DBI"
- Reply: femibyte1: "Re: Executing sproc containing multiple inserts and commits with Perl DBI"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|