Cees,

>> Is there a way to cope with a table that does not have a primary key?
> 
> Can you not just make all the columns belong to the primary key?  That
> will work unless your schema allows you to create two identical
> records in the database (not something that is often useful).

I could do that, however that forces me to load all the columns in the 
table. I've taken to building my objects with ALL known fields but those 
I'm not normally interested in I mark with a "lazy_load => 1" option.

> Remember that a primary key does not have to be just a single column.
> It can be any unique set of columns in the table.  The important bit
> is the fact that the columns need to uniquely identify a row in the
> table.

Indeed.

Interestingly, it seems that Rose::DB::Object will attempt to make the 
first field that it can lexically see in the meta hash the primary key 
IF no primary key is given. Furthermore, the manager I have the class 
automatically create still works for what I want to do even though the 
primary key is not at all uniquer.

[I have 3501 records and the "PK" that it's using has only about 10 
values - the most populous of these has some 1900+ records]

This is currently read only so if I can't write it, it won't bother me a 
bit.

DSL

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to