My guess is that line 52 corresponds to

foreach my $m(0..$#row1)

If not, you should indicate since you haven't given us 52 lines of code. In the above, $#row1 is the last index of @row1, which you don't define. Since you want the last index of the array referenced by $row1, you mean

foreach my $m(0..$#$row1)

Note the extra sigil (and see perlref and/or perlreftut). A less error prone way of writing that block assuming you don't need the index would be using a foreach loop on the array itself:

foreach my $record (@$row1) { $data_file.= $record->{'ROW_DATA'} . "\n"; }

Update: You are also accessing the array reference improperly in the line

$data_file.= "$row1[$m]{'ROW_DATA'}\n";

which should be

$data_file.= "$row1->[$m]{'ROW_DATA'}\n";

since you need to dereference that reference to access its contents. You should probably (re)read perlreftut to gain insight into how references work in Perl.


In reply to Re: How to Fetch records from Oracle DB view by kennethk
in thread How to Fetch records from Oracle DB view by Rocko19

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.