This behavior can be reproduced by these code:-- SQL Code created by Class::DBI declare @P1 int set @P1=NULL exec sp_prepare @P1 output, N'@P1 nvarchar(6)', N'SELECT orderid FROM Orders WHERE shipcountry = @P1 ', 1 select @P1
# # Northwind DBI Class # package Northwind; use base 'Class::DBI'; use strict; __PACKAGE__->set_db('Main', 'dbi:ODBC:driver={SQL Server}; Server=SERVER; database=Northwind;', 'test', '654123'); 1; package Northwind::Order; use strict; use base 'Northwind'; __PACKAGE__->table ('Orders'); __PACKAGE__->columns (Primary => qw/OrderID/); __PACKAGE__->columns (Others => qw/CustomerID EmployeeID OrderDate +RequiredDate ShippedDate ShipVia Freight ShipName ShipAddress ShipReg +ion ShipCity ShipPostalCode ShipCountry/); 1;
I've read Class::DBI POD and about "Lazy population", but I couldn't understand why I'm not getting the city on 'print "$Order->ShipCity\n";'.# # Testing Northwind database access # use Northwind; my @Orders = Northwind::Order->search( ShipCountry => 'France' ); foreach my $Order ( @Orders ){ print "$Order->ShipCity\n"; }
Thank's for any help.
In reply to Doubts about Class:DBI by shonorio
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |