OK I am beyond confused.

Changed my code as follows:

$sqlStr = "select createwbparserun( '$directory' , '$filename' ) + "; print $sqlStr. "\n" ; my $sth = $db_in->prepare( $sqlStr ); $sth->execute(); my $aryRef = $sth->fetchall_arrayref([0]); my @a = @$aryRef; print "Reference: $aryRef\n"; print "Dereferenced: @a\n"; ##print @$ary; print Dumper @a; $wb_runkey = $a[0]; print "WORKBOOK run key: " . $wb_runkey . "\n" ; die;
and got the following:
select createwbparserun( 'C:/dev/HN_optimum/' , 'FM Mk 14 - 60M200007_ +DB200609.xls' ) Reference: ARRAY(0x351fed8) Dereferenced: ARRAY(0xcf786a0) $VAR1 = [ '48' ]; WORKBOOK run key: ARRAY(0xcf786a0) Died at parseExcelWB.pl line 197.

the DBI documentation says, fetchall_arrayref returns a reference to an array that contains one reference per row. Does this mean I have to de-reference again?? Do not know how to do that.

Best

KD

In reply to Re^2: DBI fetchall_arrayref by kevind0718
in thread DBI fetchall_arrayref by kevind0718

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.