Re: Error accessing columns

[prev] [thread] [next] [Date index for 2004/04/28]

From: Michele Valzelli
Subject: Re: Error accessing columns
Date: 16:05 on 28 Apr 2004
On Wed, 28 Apr 2004, Tony Bowden wrote:

> When I test this I also get the message:
>   Column 'id' in Messagenet::DBI::Fattura clashes with built-in method 

Yes, now I also get this message. The strange thing is that I didn'get it 
while using Class::DBI::Oracle->set_up_table. It could have made things 
much clearer.... 

 
> The problem is that Class::DBI doesn't allow you to call a column 'id'
> unless it's your primary key. In your case 'id' is only *part* of your
> primary key, and so CDBI gets very confused.
> 
> The easiest workaround if you can't change the schema is to override
> the accessor name for your 'id' column:
> 
> 	sub accessor_name {
> 		my ($self, $column) = @_;
> 		return "myid" if $column eq "id";
> 		return $column;
> 	}

Well, this works perfectly!

Thanks a lot for your help.

        -- 
        Michele Valzelli - Messagenet srl
Messaggistica e Telecomunicazioni

Error accessing columns
Michele Valzelli 12:57 on 28 Apr 2004

Re: Error accessing columns
Tony Bowden 13:20 on 28 Apr 2004

Re: Error accessing columns
Michele Valzelli 14:43 on 28 Apr 2004

Re: Error accessing columns
Tony Bowden 15:18 on 28 Apr 2004

Re: Error accessing columns
Michele Valzelli 16:05 on 28 Apr 2004

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