Re: Not getting unique data in an iterator.

[prev] [thread] [next] [Date index for 2004/07/06]

From: Perrin Harkins
Subject: Re: Not getting unique data in an iterator.
Date: 14:57 on 06 Jul 2004
On Tue, 2004-07-06 at 10:01, Robert Creager wrote:
> When executing the following, the data retrieved through the inner ($v_iter)
> iterator is only the first row returned by the db query.  $v_iter does loop the
> correct number of times (48 with my db in this specific instance), but the
> data is not changing during the loop.

Looks like your setup for TASSIV::ObsV has the wrong primary key.

> package TASSIV::ObsV;
> 
> use base qw( TASSIV::DBI );
> 
> __PACKAGE__->table( 'obs_v' );
> __PACKAGE__->columns( 'Primary' => 'star_id' );
> __PACKAGE__->columns( 'Others' => qw/x y mag smag file_id/ );
> __PACKAGE__->has_a( 'file_id' => 'TASSIV::Files' );
> __PACKAGE__->has_a( 'star_id' => 'TASSIV::Catalog' );

That is saying that only star_id matters when finding rows from this
table, but since it seems to be a mapping table it probably has a
multi-column primary key.  If star_id is not unique in this table, then
it is not the primary key.

- Perrin

Not getting unique data in an iterator.
Robert Creager 14:01 on 06 Jul 2004

Re: Not getting unique data in an iterator.
Perrin Harkins 14:57 on 06 Jul 2004

Re: Not getting unique data in an iterator.
Robert Creager 02:27 on 07 Jul 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52