strange problem with Class::DBI
am 12.08.2005 21:25:28 von alexdeucher
I'm having problems using Class::DBI to access my database. I have a
postgres database with several tables and I've implemented Class::DBI
abstractions for each table. the problem is one of my tables does not
seem to want to work. The table with the problem has one primary key,
num. The tables that work have composite primary keys (combination of
fields).
whenever I try and access a field (ala this code snippet):
....
my $doc =3D MCAM::DB::Document->retrieve(num =3D> $patent_number);
print $doc->titl;
....
I get the following error:
Can't locate object method "select_row" via package "DBI::st" at
/usr/lib/perl5/site_perl/5.8.5/Class/DBI.pm line 852.
I can't figure out what is going on. I have no problems accessing the
table via DBI directly. Any ideas?
Thanks,
Alex
Re: strange problem with Class::DBI
am 12.08.2005 23:12:56 von Tim.Bunce
Google says http://qs321.pair.com/~monkads/index.pl?node_id=354212
Tim.
On Fri, Aug 12, 2005 at 03:25:28PM -0400, Alex Deucher wrote:
> I'm having problems using Class::DBI to access my database. I have a
> postgres database with several tables and I've implemented Class::DBI
> abstractions for each table. the problem is one of my tables does not
> seem to want to work. The table with the problem has one primary key,
> num. The tables that work have composite primary keys (combination of
> fields).
>
> whenever I try and access a field (ala this code snippet):
> ...
> my $doc = MCAM::DB::Document->retrieve(num => $patent_number);
> print $doc->titl;
> ...
>
> I get the following error:
>
> Can't locate object method "select_row" via package "DBI::st" at
> /usr/lib/perl5/site_perl/5.8.5/Class/DBI.pm line 852.
>
> I can't figure out what is going on. I have no problems accessing the
> table via DBI directly. Any ideas?
>
> Thanks,
>
> Alex
Re: strange problem with Class::DBI
am 15.08.2005 15:49:34 von alexdeucher
On 8/12/05, Tim Bunce wrote:
> Google says http://qs321.pair.com/~monkads/index.pl?node_id=3D354212
>=20
Thanks for the pointer, however, for those that run into this in the
future, the problem was that I hadn't passed:
RootClass =3D> 'DBIx::ContextualFetch'
in my connect methods.
Alex
> Tim.
>=20
> On Fri, Aug 12, 2005 at 03:25:28PM -0400, Alex Deucher wrote:
> > I'm having problems using Class::DBI to access my database. I have a
> > postgres database with several tables and I've implemented Class::DBI
> > abstractions for each table. the problem is one of my tables does not
> > seem to want to work. The table with the problem has one primary key,
> > num. The tables that work have composite primary keys (combination of
> > fields).
> >
> > whenever I try and access a field (ala this code snippet):
> > ...
> > my $doc =3D MCAM::DB::Document->retrieve(num =3D> $patent_number);
> > print $doc->titl;
> > ...
> >
> > I get the following error:
> >
> > Can't locate object method "select_row" via package "DBI::st" at
> > /usr/lib/perl5/site_perl/5.8.5/Class/DBI.pm line 852.
> >
> > I can't figure out what is going on. I have no problems accessing the
> > table via DBI directly. Any ideas?
> >
> > Thanks,
> >
> > Alex
>