I just started with Class::DBI and I'm having some issues.

The problem I'm having is that when I run the following: ./dupe_charts.pl 74

I get the following error:

chart is not a column of CCopy::Chart_Item_XREF at /usr/local/share/perl/5.8.4/Class/DBI/Relationship/HasMany.pm line 118

#### Class dbi instance script ###### use strict; use CCopy; my $owner_id = shift || die "Must call with a site id to copy to."; my $it = CCopy::Chart->retrieve_all; while (my $chart = $it->next) { *********** $chart->items; *************** }

#### module ####### package CCopy; use base 'Class::DBI'; CCopy->connection($dsn, $user, $password); package CCopy::Chart; use base 'CCopy'; CCopy::Chart->table('CHART'); CCopy::Chart->columns(Primary => qw/ chart_id /); CCopy::Chart->columns(Essential => qw/ title description owner_id owne +r_type_id chart_type/); CCopy::Chart->has_many(items => 'CCopy::Chart_Item_XREF'); package CCopy::Chart_Item_XREF; use base 'CCopy'; CCopy::Chart_Item_XREF->table('CHART_ITEM_XREF'); CCopy::Chart_Item_XREF->columns(Primary => qw/ chart_id item_id /); CCopy::Chart_Item_XREF->columns(All => qw/ insert_dtime update_dtime / +); ################################

The two tables have these columns:

########### CHART ################## chart_id insert_dtime update_dtime owner_id owner_type_id title description featured chart_type ######## CHART_ITEM_XREF ########### chart_id item_id status_code feature_flag priority_level insert_dtime update_dtime locked_flag special_flag mandatory_flag
Godzirra! Destroying Neo Tokyo since 1954

In reply to Class DBI Problems by godzirra

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.