DBI:CSV join ... flashback to 2002



Question about joining using DBI:CSV. I must be making a stupid
mistake somewhere.

Earlier posts (2002) state that there were problems using aliases in
joins. I've just installed the modules on a windows machine and am
having the same problems.
DBI (v1.58)
SQL-Statement(v1.15)
Text-CSV_XS(v.3)
DBD-CSV(v.22)
DBD-File(v.35)

Running a simple query with no aliases works.

When I run the same query with an alias i get an error message
(below). However, the error message is followed by the correct query
results.

$sth = $dbh->prepare("Select b.subject from table_b.csv as b");
$sth = $dbh->prepare("Select a.subject from table_a.csv as a");
SQL ERROR: Table 'CSV' referenced but not found in FROM list!


I then tried a simple join (using where a.subject=b.subject). I get
the error referenced in previous posts.

$sth = $dbh->prepare("Select a.subject from table_a.csv as a,
table_b.csv as b where a.subject=b.subject");
DBD::CSV::st execute failed: Can't call method "col_names" on unblessed reference at c:\perl\site\lib\SQL\Statement.pm line 610, <GEN> line 1.
[for Statement "Select a.subject from table_a.csv as a, table_b.csv as
b where a.subject=b.subject"] at temp.pl line 14


I then tried using the join syntax instead of the WHERE statement as
suggested in the previous post, but i get an error message

$sth = $dbh->prepare("Select * from table_a.csv natural join
table_b.csv");
SQL ERROR: Couldn't parse the explicit JOIN!

table_a.csv
-----------------
chromosome,snp,subject,xx
1,rs1203,102,A
1,rs1203,1025,A
1,rs1203,1034,A
1,rs1203,1078,A

table_b.csv
-----------------
subject
102
1025
1034


If anyone has any suggestions, please let me know. I would greatly
appreciate it.

cheers,
david

.



Relevant Pages

  • Re: DBI:CSV join ... flashback to 2002
    ... The dot have special meanings in SQL for table names and is not just an allowed character. ... Running a simple query with no aliases works. ... When I run the same query with an alias i get an error message ... the error referenced in previous posts. ...
    (perl.dbi.users)
  • RE: DBI:CSV join ... flashback to 2002
    ... Another way to remove the dot in the query is as follows. ... When I run the same query with an alias i get an error message ... the error referenced in previous posts. ...
    (perl.dbi.users)
  • Re: Access MySQL
    ... You are making posts all over the place. ... How are people here who volunteer ... at least give some info as to what your error message is, ...
    (microsoft.public.access.formscoding)
  • Re: COOD1197
    ... Windows Media Player version (on the Help menu, ... If an error message is displayed, note the error message text (for example, ... I have read through the posts and cannot find an answer to this error ... > Not sure what part is bring rude, ...
    (microsoft.public.windowsmedia.player)
  • Re: Calculating averages
    ... leave my own posts marked as unread for a week and use the ... You can use any record source field in a form/report ... if your record source query has ... quantity and price fields and the price field is calculated ...
    (microsoft.public.access.reports)