[CDBI] Re: delete on table with multiple pks

William Ross will at spanner.org
Sun Nov 27 00:29:36 GMT 2005


On 25 Nov 2005, at 23:09, Jim Salladin wrote:

> Is there some more code can I provide to make this issue more
> accessible for help?

multiple-column primary keys aren't that common with cdbi, as they're  
only recently supported and not really that thoroughly. That's  
probably why it's quiet.

>> The error I get is this:
>> Can't delete 1/3: DBD::Oracle::st execute failed: called with 1 bind
>> variables when 2 are needed.

the active ingredient here is:

   eval { $self->sql_DeleteMe->execute($self->id) };

(cdbi line 705)

the call to $self->id should return a list of two key values suitable  
for binding to the delete statement, but it isn't: you're only  
getting one. I don't know why. What do you get when you call $self- 
 >id directly?

by the way, are you inflating either of the key columns with a has_a  
relationship? that's not allowed.

will





More information about the ClassDBI mailing list