Re: column called 'id'
[prev]
[thread]
[next]
[Date index for 2004/06/18]
On Fri, Jun 18, 2004 at 04:58:26PM +0100, Robert Collier wrote:
> All my tables have a a primary key called 'id'. This seems to conflict
> with the 'id' function in Class::DBI.
> Is there any workaround?
That shouldn't be a problem. You're allowed a column called 'id', as
long as it's your primary key.
> __PACKAGE__->columns(ALL => qw/id isbn title media publisher
That should be 'All' rather than 'ALL'.
When you use 'All', Class::DBI will assume, in the absence of any other
declaration, that the first column specified is your Primary Key. But
because you've used ALL, it doesn't do that, and so doesn't realise 'id'
is your PK, and so complains...
Tony
|
|
Re: column called 'id'
Tony Bowden 16:44 on 18 Jun 2004
|