提供一下测试文件吧

2010/11/17 ZHANG Jiaqiang A <[email protected]>

>  大家好,
>
> 有一张表,我需要多次关联,设了不同的别名,但是执行SQL的时候报错,大家有用过DBD-CSV的高手,帮我看看这是DBDCSV的限制还是SQL写的不对
>
> SQL语句:
> select c.husband,h.age,c.wife,w.age from couple c, people h, people w where
> c.husband = h.name and c.wife = w.name;
>
> 报错信息:
> DBD::CSV::st execute failed: Error 2012 while reading file
> D:\Perl\people.csv: E
> OF - End of data in parsing input stream at
> C:/strawberry/perl/site/lib/SQL/Stat
> ement.pm line 813
>  [for Statement "select c.husband,h.age,c.wife,w.age from couple c, people
> h, pe
> ople w where c.husband = h.name and c.wife = w.name"] at csv.pl line 99.
>
>
> 以下SQL语句都可以正常执行:
>
> select * from couple;
>
> husband    |wife       |
> ========================
> James      |Mary       |
> Roger      |Lily       |
> ========================
> Return 2 columns and 2 lines
>
> select * from people;
>
> name       |age        |
> ========================
> Mary       |22         |
> Lily       |26         |
> Roger      |24         |
> James      |30         |
> ========================
> Return 2 columns and 4 lines
>
> select c.husband,h.age from couple c, people h  where c.husband = h.name;
>
> c.husband  |h.age      |
> ========================
> James      |30         |
> Roger      |24         |
> ========================
> Return 2 columns and 2 lines
>
> select c.wife,w.age from couple c, people w where c.wife = w.name;
>
> c.wife     |w.age      |
> ========================
> Mary       |22         |
> Lily       |26         |
> ========================
> Return 2 columns and 2 lines
>
>
> 祝好
> 家强
>
> --
> 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
> 要向此网上论坛发帖,请发送电子邮件至 [email protected]。
> 要取消订阅此网上论坛,请发送电子邮件至 
> [email protected]<perlchina%[email protected]>
> 。
> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
>

-- 
您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
要向此网上论坛发帖,请发送电子邮件至 [email protected]。
要取消订阅此网上论坛,请发送电子邮件至 [email protected]。
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

回复