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


.



Relevant Pages

  • RE: How to perform JOINs with DBI
    ... How to perform JOINs with DBI ... What does the query do in SQL*Plus? ... intended recipient, please be aware that any disclosure, copying, distribution ... sender of the delivery error by replying to this message, or notify us by ...
    (perl.dbi.users)
  • Re: Oracles RPAD problematic via Perls DBI module
    ... > use DBI; ... > This problem occurs only for a blank string. ... > If I run the query via sqlplus: ...
    (comp.lang.perl.misc)
  • Re: Order by statement stopped working but not in all cases
    ... If what you say is true and none of you SW (Perl, DBI, DBD, Oracle) has ... by statement in the query, it again returned results though not sorted. ... The apps have not been changed in the past week. ...
    (perl.dbi.users)
  • RE: binding multiple values and retain blanks
    ... Join this table to the main table in your query. ... When i do like above, trailing spaces are lost, as DBI treats default ... So i have to bind one value at a time and specify type as CHAR in order ...
    (perl.dbi.users)
  • Re: Error on DBI
    ... DBI never falsely reports errors. ... Copy and paste the SQL statement from rpt_preview.plx into an SQL query tool, and use the username and password from rpt_preview.plx to login. ...
    (perl.dbi.users)