shonorio has asked for the wisdom of the Perl Monks concerning the following question:
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Doubts about Class:DBI
by dtr (Scribe) on Aug 24, 2005 at 14:24 UTC | |
|
Re: Doubts about Class:DBI
by shonorio (Hermit) on Aug 24, 2005 at 15:08 UTC | |
|
Re: Doubts about Class:DBI
by perrin (Chancellor) on Aug 24, 2005 at 14:11 UTC | |
by shonorio (Hermit) on Aug 24, 2005 at 14:51 UTC | |
by davidrw (Prior) on Aug 24, 2005 at 14:57 UTC | |
by shonorio (Hermit) on Aug 24, 2005 at 15:11 UTC | |
|
Re: Doubts about Class:DBI
by davidrw (Prior) on Aug 24, 2005 at 14:19 UTC | |
by shonorio (Hermit) on Aug 24, 2005 at 14:59 UTC | |
|
Re: Doubts about Class:DBI
by monkey_boy (Priest) on Aug 24, 2005 at 14:24 UTC |