Composite keys

[prev] [thread] [next] [Date index for 2005/05/04]

From: Kevin Old
Subject: Composite keys
Date: 19:53 on 04 May 2005
Hello everyone,

I have the following tables defined via CDBI:

package IVR::EmpCustXref

my $table =3D '[Employee Customer Xref]';
__PACKAGE__->table($table);

__PACKAGE__->columns(All =3D> qw/customernum storenum sup rep service/);

__PACKAGE__->columns(Primary =3D> qw/customernum storenum/);



package IVR::CustStoreDetails

my $table =3D '[Customer Store Details Table]';
__PACKAGE__->table($table);

__PACKAGE__->columns(All =3D> qw/customernum storenum address city state
zip phone fax shipvia/);

__PACKAGE__->columns(Primary =3D> qw/customernum storenum/);


I'm accessing these tables via an ODBC connection against a MS SQL
Server 2000 database.

I'd like to create a has_a() statement on EmpCustXref for customernum
AND storenum against CustStoreDetails.

I've tried this:

__PACKAGE__->has_a(customernum =3D> "IVR::M::CustStoreDetails");
__PACKAGE__->has_a(storenum =3D> "IVR::M::CustStoreDetails");

But I get this error over and over when running a query:

Odd number of elements in anonymous hash at
/usr/lib/perl5/site_perl/5.8.3/Class/DBI.pm line 1039.

The query I'm running is (in EmpCustXref):

__PACKAGE__->set_sql(emps =3D> qq {
                        select *
                        from __TABLE__
                        });

Anyone ever seen this?  Any ideas how I can go around this?

Any help is appreciated!
--=20
Kevin Old
kevinold@xxxxx.xxx

Composite keys
Kevin Old 19:53 on 04 May 2005

Re: Composite keys
Perrin Harkins 20:24 on 04 May 2005

Re: Composite keys
Kevin Old 20:59 on 04 May 2005

Re: Composite keys
Perrin Harkins 21:10 on 04 May 2005

Re: Composite keys
Kevin Old 21:45 on 04 May 2005

Generated at 16:36 on 28 Jul 2005 by mariachi v0.52