[ic] $db-->query inner join

Stefan Hornburg racke at linuxia.de
Tue Mar 10 15:35:33 UTC 2009


Sam Batschelet wrote:
> 
> 
> On 3/10/09 10:14 AM, "jimbo" <jimbo at soundimages.co.uk> wrote:
> 
>>> my $q = $db->query({
>>>
>>> sql => 'SELECT sum(quantity) FROM inventory INNER JOIN variants WHERE
>>> inventory.sku = variants.code and variants.sku=$sku',
>>>
>>> });
>> Did you make sure to open the tables in the [perl] tag?
>>
>> [perl tables="inventory variants"][/perl]
>>
>> jimbo
>> ;-)>
>>
> I did it this way is this wrong?  I am trying to not use ITL in this script
> if possible.
> 
> my $db = $db{inventory, variants};

$Tag->perl({tables => 'inventory'});

$db = $Db{inventory} # note capital D

would work if both tables share the same DBI connection.

Regards
	Racke

-- 
LinuXia Systems => http://www.linuxia.de/
Expert Interchange Consulting and System Administration
ICDEVGROUP => http://www.icdevgroup.org/
Interchange Development Team




More information about the interchange-users mailing list