develooper Front page | perl.dbi.users | Postings from February 2008

missing records while running a query using DBI

Thread Next
From:
Abi Alias
Date:
February 7, 2008 09:50
Subject:
missing records while running a query using DBI
Hello,
I am generating a report in Perl and data's are from oracle. Connecting 
via DBI module.

I run the following query directly in SQLPLUS and got 25 result.


    SELECT item.*   FROM tmp_loadplan_items item,tmp_loadplans loadplan
         WHERE loadplan.nreference_code = 'NYCWHAM30011258'
         AND loadplan.id = item.tmp_loadplans_id ORDER BY nposition ASC

But When I run the same  query using DBI, I am getting only 14 result.



Part of the code I am using.
=================

$query = qq{
            SELECT item.*
            FROM tmp_loadplan_items item,tmp_loadplans loadplan
            WHERE loadplan.nreference_code = '$cReference'
            AND loadplan.id = item.tmp_loadplans_id
        };

my $sth = $dbh->prepare( $query )
    or die "Can't prepare statement: $DBI::errstr";


print "\n Query is \n";
print "\n";
print $query;
print "\n";

print " Total results set: ".$sth->execute();
undef $query;
print "\n";
exit;


Version of DBI : 1.53
SQL*Plus: Release 3.3.4.0.0


Is this a bug, or have I done something monstrously wrong?

Thanks and regards,

Abi Alias



Thread Next


Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About