http://www.perlmonks.org?node_id=279345


in reply to Class::DBI Intro

Nice tutorial. ++

A number of things I'd be curious to see added:

Good stuff,
Matt

Replies are listed 'Best First'.
Re: Re: Class::DBI Intro
by salvadors (Pilgrim) on Aug 01, 2003 at 07:58 UTC

    (but note that your join table still requires a primary key)

    Actually, it doesn't always. As long as the relationship is unique, the cross-reference itself can be treated as a multi-column primary key, even if it isn't defined as such in the database.

    Strange things can happen with this if you step off the (admittedly very narrow) beaten path, but for general cross-referencing it seems to work just fine.

    Tony

      Actually, it doesn't always. As long as the relationship is unique, the cross-reference itself can be treated as a multi-column primary key, even if it isn't defined as such in the database.

      Can you give an example? I'm still learning about Class::DBI, but thus far I have not found a way to avoid it claiming the first column as a primary key (in the absence of such a declaration in the DB table itself).

      Matt