Hi
I have changed the fetching loop as you said and now I am getting 25
result and my script works fine now. Thankyou.

But at end of execution,I am getting a warning like
"
DBD::Oracle::st fetchrow_hashref warning: (err=0, errstr=undef,
state=undef) [for Statement "
            SELECT item.nreference, item.chold, item.npieces,
item.nweight,
                   item.ncube, item.cshippername,
item.cwarehouselocation,
                   item.chazardous_code, item.cdestination,
item.ccomments,
                   item.nposition, item.ccargodescription,
                   item.ccargodescription2, item.cshipper_ref,
                   item.ccommunication_ref
            FROM tmp_loadplans loadplan, tmp_loadplan_items item
            WHERE loadplan.nreference_code = ?
            AND loadplan.id = item.tmp_loadplans_id
        ORDER BY nposition ASC" with
ParamValues: :p1='NYCWHAM30011258'] at cme231.pl line 353.




This is the code I am using
--------------------------

$query = qq{
            SELECT item.nreference, item.chold, item.npieces,
item.nweight,
                   item.ncube, item.cshippername,
item.cwarehouselocation,
                   item.chazardous_code, item.cdestination,
item.ccomments,
                   item.nposition, item.ccargodescription,
                   item.ccargodescription2, item.cshipper_ref,
                   item.ccommunication_ref
            FROM tmp_loadplans loadplan, tmp_loadplan_items item
            WHERE loadplan.nreference_code = ?
            AND loadplan.id = item.tmp_loadplans_id
        };

if ($cReport eq 'NOT_RECEIVED') {
    $cReportTitle .= ' (ITEMS NOT RECEIVED)';
    $query .= qq( AND item.ccomments = 'NOT RECEIVED' );
}

$query .= qq(ORDER BY nposition ASC);

my $sth = $dbh->prepare( $query );

 $sth->execute($cReference)
    or die "Can't execute statement: $DBI::errstr";

# Start the report
$rep->start;


# Print the result
# changed the query fetching using hash array
while (my $tmp = $sth->fetchrow_hashref('NAME_lc'))
{
   my  %hashRef = %{$tmp} if (defined($tmp) && ref($tmp) eq "HASH");

    $nReference         = $hashRef{nreference};
    $cHold              = $hashRef{chold};

-----
----
----

} undef $tmp;

$sth->finish; undef $sth;


Please let me know if I have missed anything?






Reply via email to