[ic] $Sql{orderline} fails?

Grant emailgrant at gmail.com
Sun Dec 13 00:19:21 UTC 2009


>> I have a usertag I've been using for a while which creates a PDF file
>> of an order.  This morning I was making some modifications to it, and
>> it stopped working with "Couldn't get orderline handle" in the
>> error.log.  I restored the original file, but it still fails with that
>> error, even after rebooting the machine.  Here is the pertinent code:
>>
>> my $dbh = $Sql{orderline} or die "Couldn't get orderline handle\n";
>>
>> The orders table is still being read and written to just fine.  Does
>> anyone know what causes a line like the above to fail?
>
> Make sure that you have orderline table open first, ie:
>
> $Tag->perl('orderline');
> my $dbh = $Sql{orderline} or die "Couldn't get orderline handle\n";
>
>
> Peter

Thanks a lot Peter, that fixed it.  Any idea why that line wasn't
necessary originally?  Here was the entire original block:

my $db = Vend::Data::database_exists_ref('orderline');
my $sql = "SELECT sku, quantity, price FROM orderline WHERE
order_number = $order_number AND quantity > 0";
my $dbh = $Sql{orderline} or die "Couldn't get orderline handle\n";

That seemed to be sufficient before.

- Grant



More information about the interchange-users mailing list