-- 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 ShipRegion ShipCity ShipPostalCode ShipCountry/);
1;
####
#
# Testing Northwind database access
#
use Northwind;
my @Orders = Northwind::Order->search( ShipCountry => 'France' );
foreach my $Order ( @Orders ){
print "$Order->ShipCity\n";
}