in reply to Re: DBI fetchall_arrayref
in thread DBI fetchall_arrayref
OK I am beyond confused.
Changed my code as follows:
and got the following:$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;
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
|
|---|