Hi, again,
First of all, thanks to Jeff Zucker for clueing me
in on the existence of two versions of SQL::Statement
for use with DBD::CSV, one of which (the one I was
using) doesn't support textual comparisons, the other
one of which does. More details may be found at
http://www.vpservices.com/jeff/programs/sql-compare.html.
I just downloaded the one that supports the
comparison, and it's working fine now!
Now in typical newbie fashion, I've solved one
problem with the help of the list, only to quickly
find *another* that I have to turn around and ask you
about! ;-) I got all excited to see that these new
modules also support joins, which I wasn't sure if I
could do with the old one, so right away, I tried a
join. It didn't work. I perused "perldoc
SQL::Statement" and found something about creating a
parser object and enabling select.join, but it wasn't
clear to me exactly how to do that. I've never
instantiated the parser itself before, I always just
create the database connection, get a statement object
from the connection's prepare method, and execute that
statement. So I tried adding the following code to my
test program:
my $parser = SQL::Parser->new('Ansi');
$parser->feature( 'select', 'join', 1 );
But it didn't seem to make any difference. But then, I
was only guessing.
Here's my program output now:
C>perl runSQL.pl "SELECT Title FROM Shows"
Statement to execute: "SELECT Title FROM Shows"
Results:
----
Steel Magnolias
----
The Sound of Music
----
Two One-Acts
So I know "Title" is a valid field in "Shows". But
then:
C>perl runSQL.pl "SELECT S.Title, P.PerfDate FROM
Shows S, ShowTimes P WHERE P.ShowID = S.ShowID"
Statement to execute: "SELECT S.Title, P.PerfDate
FROM Shows S, ShowTimes P WHERE P.ShowID = S.ShowID"
Results:
Execution ERROR: No such column 'SHOWS.TITLE'
called from runSQL.pl at 11.
DBD::CSV::st execute failed: Can't call method
"col_names" on unblessed referenc
e at C:/Perl/site/lib/SQL/Statement.pm line 499,
<GEN1> line 1.
Cannot execute SQL statement: Can't call method
"col_names" on unblessed referen
ce at C:/Perl/site/lib/SQL/Statement.pm line 499,
<GEN1> line 1.
Any thoughts would be appreciated.
- John
=====
"Now it's over, I'm dead, and I haven't done anything that I want; or, I'm still
alive, and there's nothing I want to do." - They Might Be Giants, http://www.tmbg.com
__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com