I'm trying to run a query and I can't figure out what's wrong here. I've consulted some people and they say my query looks right. The query I'm having problems with is the second one. Using a WHERE and a JOIN is giving me the following error:
Use of uninitialized value in substitution iterator at /usr/lib/perl5/
+site_perl/5.8.6/SQL/Parser.pm line 1596.
#!/usr/bin/perl
use strict;
use warnings;
use DBI;
# Connect to the database, (the directory containing our csv file(s))
my $dbh = DBI->connect("DBI:CSV:f_dir=.;csv_eol=\n;");
# Associate our csv disk file with the table names
$dbh->{'csv_tables'}->{'info'} = { 'file' => "psinfooutputfile.csv"};
$dbh->{'csv_tables'}->{'hosts'} = { 'file' => "wmioutputfile.csv"};
$dbh->{'csv_tables'}->{'hostinfo'} = { 'file' => "hosts.csv"};
$dbh->{'csv_tables'}->{'saninfo'} = { 'file' => "sanhosts.csv"};
$dbh->{'csv_tables'}->{'software'} = { 'file' => "softwareinfo.csv"};
######
$dbh->do("DROP TABLE IF EXISTS hostsinfo");
$dbh->do("
CREATE TABLE hostinfo
AS SELECT hosts.IP, Manufacturer, Model, OS, OSSP, RAM, CPUSpe
+ed, CPUCount, CPUType
FROM hosts
LEFT JOIN info ON hosts.IP = info.IP
");
# Problem Query
$dbh->do("
CREATE TABLE saninfo
AS SELECT hostinfo.IP, Manufacturer, Model, OS, OSSP, RAM, CP
+USpeed, CPUCount, CPUType, SOFT
FROM hostinfo
JOIN software ON hostinfo.IP = software.IP
WHERE SOFT LIKE '%Secure Path%'
");
The "SOFT" column is from the software table.
Any ideas?