Re: Error accessing columns
[prev]
[thread]
[next]
[Date index for 2004/04/28]
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