OK the code below works. the de-referencing is tricky

$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 }[0]; print "Reference: $aryRef\n"; print "Dereferenced: $a\n"; print "Deref again: ${$a}[0] \n"; $wb_runkey = ${$a}[0]; print $aryRef->[0]->[0] . "\n"; ##print Dumper @a; ##$wb_runkey = $a[0]; print "WORKBOOK run key: " . $wb_runkey . "\n" ;
it produces the following:

select createwbparserun( 'C:/dev/HN_optimum/' , 'FM Mk 14 - 60M200007_ +DB200609.xls' ) Reference: ARRAY(0x34dfed8) Dereferenced: ARRAY(0xd5079a8) Deref again: 55 55 WORKBOOK run key: 55 Died at parseExcelWB.pl line 198.
Here is a link the explains the de-referencing: http://www.thegeekstuff.com/2010/06/perl-array-reference-examples/

thanks for your kind assistance.

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.