rkrish has asked for the wisdom of the Perl Monks concerning the following question:
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; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem in fetching columns from select query
by NetWallah (Canon) on Dec 27, 2012 at 07:25 UTC | |
|
Re: Problem in fetching columns from select query
by Jenda (Abbot) on Dec 27, 2012 at 19:58 UTC |