Most likely, your use of {syb_more_results} is wrong. Most likely, this is because you're not using DBD::Sybase but something else. Reduce your code. Write a real small and short script that only connects to the database and fetches the results, instead of pulling in all your other in-house libraries. Throw out the following modules from your sample program:

use KAP; #internally developed library. use Date::Manip; #internally developed library. use DBAccess; use EQ_Misc; #internally developed library. use DBD::CSV; use MIME::Lite; use Net::SMTP;

Date::Manip likely is not an "internally developed library" anyway. After you've thrown out these, your script should basically look like:

use strict; use DBI; use Data::Dumper; my $dbh = DBI->connect(...); my $sp = 'lv..check_tax_lot'; warn "Preparing [$sp]"; my $sth = $dbh->prepare($sp); warn "Running [$sp]"; my $res = $sth->execute(); warn "Got results ($res):"; if (! $res) { die $sth->errstr; }; my $results = $sth->fetchall_arrayref; print Dumper $results;

Also, your post should have been a reply below Re: Writing Multiple Recordsets into a CSV file, where you already got a good answer and I consider it good courtesy to at least mention that others have helped you already and where they have.


In reply to Re^5: Writing Multiple Recordsets into a CSV file by Corion
in thread Writing Multiple Recordsets into a CSV file by sudip_dg77

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.