Hi I have a select query that fetches three columns and i need to store them in perl variables. The code I'm having and is not working is as follows: I have used last in while loop to ensure that control should come out of loop after first iteration.

my ( $AcctNbr, $CycCd, $CycEndDt ); my $dly1 = $lda ->prepare("select acct_nbr,cycle_c +d,cycle_end_dt from USAGE_FLATF_DLY_INDEX_1 where acct_nbr= ? order +by cycle_end_dt "); $dly1->bind_param(1,$Acct); $dly1->execute(); $dly1->bind_col(1,\$AcctNbr); $dly1->bind_col(2,\$CycCd); $dly1->bind_col(3,\$CycEndDt); while ( $dly1->fetchrow_arrayref()) { print ("Acct Nbr is $AcctNbr ,Cycle cd is $Cyc +Cd,cycle end date is $CycEndDt "); rerateandupdate($AcctNbr); last; }

In reply to Problem in fetching columns from select query by rkrish

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.