http://www.perlmonks.org?node_id=727389

joec_ has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I have a PL/SQL function, which returns a cursor of 1100 rows. In TOAD this takes 895ms, if i implement this in DBI with DBD::Oracle it takes 42 seconds. Would there be any particular reason for this or is it just the DBI implementation?

Here is my code:

$sth_dipp = $dbh_ideas->prepare(q{DECLARE dipp PacProject.dipp_project +_cur; BEGIN pacproject.get_dipp_projects(:dipp); END;}); $sth_dipp->bind_param_inout(":dipp",\$s_dipp_proj,0,{ora_type => ORA_R +SET}); $sth_dipp->execute; while (@projects=$s_dipp_proj->fetchrow_array){ $name = $projects[1]; $code = $projects[2]; $RA = $projects[4]; $manager = $projects[7]; if (defined($manager) && defined($name) && defined($code) && defin +ed($RA)){ $csv = $csv . "$name,$code,$RA,\"$manager\"\n"; }else{ if (not defined($name)){$name="Unknown";} if (not defined($code)){$code="Unknown";} if (not defined($RA)){$RA="Unknown";} if (not defined($manager)){$manager="Unknown";} $csv = $csv . "$name,$code,$RA,\"$manager\"\n"; } } print $csv;

TIA

Joe