I'm having trouble with some code that I copied from perldoc. The code is supposed to create a hash of the current record with the filenames as keys. Here's the relevant portion:
====
$dbh = DBI->connect('dbi:ODBC:GTDB', '', '');
$sth = $dbh->prepare("SELECT * FROM Contacts INNER JOIN ON (Contacts.Responsible = Users.UserID) WHERE ID = ?");
$sth->execute(param(ID));
my %row;
$sth->bind_columns( \( @row{ @{$sth->{NAME_lc} } } ));
$sth->fetch;
====
The code works perfectly without the inner join clause in the SQL statement, but as soon as I add the INNER JOIN Clause I get:
"Describe failed during DBI::st=HASH(0xe7e96c)->FETCH(NAME) at E:/Apache2/perl/GT/contact_view.pl line 32."
Any help would be greatly appreciated, I'm not relishing having to refer to the fields by numbers instead of names.
Thanks in advance!
Andrew
====
$dbh = DBI->connect('dbi:ODBC:GTDB', '', '');
$sth = $dbh->prepare("SELECT * FROM Contacts INNER JOIN ON (Contacts.Responsible = Users.UserID) WHERE ID = ?");
$sth->execute(param(ID));
my %row;
$sth->bind_columns( \( @row{ @{$sth->{NAME_lc} } } ));
$sth->fetch;
====
The code works perfectly without the inner join clause in the SQL statement, but as soon as I add the INNER JOIN Clause I get:
"Describe failed during DBI::st=HASH(0xe7e96c)->FETCH(NAME) at E:/Apache2/perl/GT/contact_view.pl line 32."
Any help would be greatly appreciated, I'm not relishing having to refer to the fields by numbers instead of names.
Thanks in advance!
Andrew