rdwaters has asked for the wisdom of the Perl Monks concerning the following question:
Supposedly, using DataHash enables you to specify the column name. In this case the column name is 'server_name' but perl treats it like a string with or without quotes. You can use the Data method, but it returns the rows as one big string which is impossible to parse correctly.use Win32::ODBC; $login = "DSN=ODBCTest"; $sql_text = "SELECT * from tblServer"; $conn = new Win32::ODBC($login) or die "Error Connecting! " . Win32::ODBC::Error(); if (! $conn->Sql($sql_text)) { while ($conn->FetchRow()) { my $data = $conn->DataHash(); print "$data('server_name')\n"; } } $conn->Close();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Data returned from Win32::ODBC
by snax (Hermit) on Oct 15, 2003 at 20:35 UTC | |
|
Re: Data returned from Win32::ODBC
by Solo (Deacon) on Oct 15, 2003 at 20:39 UTC | |
|
Re: Data returned from Win32::ODBC
by rdwaters (Initiate) on Oct 16, 2003 at 13:14 UTC |