Have you tried this with the latest SQL::Statement?  If not, do it as
SQL::Statement now supports certain joins.

Ilya

> -----Original Message-----
> From: Marcus [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, April 15, 2002 11:06 PM
> To: [EMAIL PROTECTED]
> Subject: DBD::AnyData joins
> 
> 
> I've just installed AnyData and I'm having difficulty 
> figuring out how to translate the following SQL statements 
> into something AnyData can work with. I have the latest 
> versions of AnyData and SQL::Statement, and I thought the 
> latter could now do joins.
> 
> I've tried the example for multiple tables in the 
> documentation, but I don't understand how that works yet. Any 
> help would be greatly appreciated. I have two tables added 
> and they work fine with simple queries.
> 
> $dbh->func( 'nodes', 'CSV', 'nodes.csv', 'ad_catalog');
> 
> $dbh->func( 'nodereferences', 'CSV', 'nodereferences.csv', 
> 'ad_catalog');
> 
> But how do you do these?
> Here are the two statements:
> 
> 1)
> 
> $sql_current_node_data = "
>           SELECT Nodes.NodeTitle, Nodes.NodeText, 
> Nodereferences.ReferenceType
>           FROM Nodes, Nodereferences
>               WHERE Nodes.NodeID = $current_node 
> AND Nodereferences.RecipientNodeID =$current_node";
> 
> 
> 2)
> my $sql_children = "
>           SELECT Nodes.NodeID, Nodes.NodeTitle, 
> NodeReferences.NodeReferenceID
>           FROM Nodes, NodeReferences
>               WHERE Nodes.NodeID = NodeReferences.RecipientNodeID
>               AND NodeReferences.ReferringNodeID = $current_node 
> AND NodeReferences.ReferenceType =  'child' ";
> 
> 
> Thanks,
> 
> Marcus
> 

Reply via email to