First of all: Thanks it helped!
I posted it here, because I wasn't sure, if it may be a DBD-Oracle bug
though...
Henning
On Thu, Nov 28, 2002 at 12:13:01PM +0000, Tim Bunce wrote:
> Try $dbh->prepare($call, { ora_check_sql => 0 });
>
> (The underlying issue is either an Oracle bug or that one of the
> two parse steps counted isn't a real parse. DBD::Oracle does a
> 'describe only' execute at prepare() time and then a normal execute
> when execute() is called. The execute() should not count as a parse
> as it has already been parsed, but oracle seems to do, or at least
> count, another parse.)
>
> Tim.
>
> p.s. This is not about the development of drivers so belongs on
> dbi-users and not on dbi-dev.
>
> On Thu, Nov 28, 2002 at 11:37:59AM +0100, Henning Meyer wrote:
> > Hello,
> >
> > I use Perl 5.6.0, DBI 1.30 and DBD-Oracle 1.12.
> > While checking the performance, my Oracle-Tools discovered, that the
> > Database does two prepares for every
> > execute.
> >
> > My Perl-Code looks like this:
> >
> > my $cur=$dbh->prepare($call);
> > die "Prepare-Error: $DBI::err\n$call\n$DBI::errstr\n" if
> > ($DBI::err);
> > $cur->execute(@$vars);
> > die "Execute-Error:
> > $DBI::err\n$call\n$DBI::errstr\n" if
> > ($DBI::err);
> > my @res=();
> > while (my $href=$cur->fetchrow_hashref) {
> > die "Fetch-Error: $DBI::err\n$call\n$DBI::errstr\n" if
> > ($DBI::err);
> > for(keys %$href) {
> > $href->{$_}=~s/[\s]*$//;
> > $href->{$_}=~s/^[\s]//;
> > }
> > push(@res,$href);
> > }
> > $cur->finish;
> > return(\@res);
> >
> > How could it be, that there is an prepare/execute ratio of 2? I have execute much
>equal +statements with bind-Values, and its very annoying that there are 400 prepares
>for 200 +executes instead of one prepare.
> >
> > Any hints?
> >
> > Henning
> >
> > --
> > '''
> > (0 0)
> > +-------oOO----(_)-------------+
> > |Henning Meyer |
> > |SIEMENS AG ICM N PG ES PD D 2|
> > +--------------------oOO-------+
> > |__|__|
> > || ||
> > ooO Ooo
--
'''
(0 0)
+-------oOO----(_)-------------+
|Henning Meyer |
|SIEMENS AG ICM N PG ES PD D 2|
+--------------------oOO-------+
|__|__|
|| ||
ooO Ooo