in reply to Re: MSSQL Select to an array: error with selectcol_arrayref
in thread MSSQL Select to an array: error with selectcol_arrayref

Okay, I replaced the line as suggested from
@EasySetTableNames = @{$sqlCmd->selectcol_arrayref($sqlStatement)};
to
@EasySetTableNames = @{$dbh->selectcol_arrayref($sqlStatement)};
and now get this error:
Can't use an undefined value as an ARRAY reference at C:\temp\test.pl +line 29 (#1) (F) A value used as either a hard reference or a symbolic referenc +e must be a defined value. This helps to delurk some insidious error +s.
I thought I had defined the array, but as mentioned before I'm baffled as to how Perl handles arrays and strings and going between them.
Do you believe in miracles? Yes!

Replies are listed 'Best First'.
Re^3: MSSQL Select to an array: error with selectcol_arrayref
by pfaut (Priest) on Dec 14, 2007 at 15:45 UTC

    It looks like your select statement didn't work. The only thing being used as an array reference in that statement is the result from selectcol_arrayref. I would check what you are using for an SQL statement and make sure it is valid.

    90% of every Perl application is already written.
    dragonchild
      Hmmm...I suspect you are correct. When I turn off Strict, the script runs and shows 0 results (in code I did not include).
      BUT BUT BUT...When I run this SQL in Query Analyzer, it does return values.
      Does anyone know if querying System Views (in this case INFORMATION_SCHEMA.TABLES) is handled strangely?
      Do you believe in miracles? Yes!