Re: Getting data out of objects
[prev]
[thread]
[next]
[Date index for 2005/04/27]
On 27 Apr 2005, at 20:53, Gordon Haverland wrote:
> I am getting confused.
>
> I am trying to work with a bunch of small tables in a SQLite
> dbase. Methods in C::DBI that calculate a SQL instruction and
> then execute it, seem to work fine. For example, if I have 5
> rows in a table and do a retrieve_all on that table, the array
> that is returned has 5 entries in it. And each entry has the
> correct reference (Class).
>
> If the primary key is a single column, I gather a person can do
> $obj->id;
> to retrieve it. Or, if the name of that column is account_id, you
> could also do:
> $obj->account_id;
> I've tried the $obj->id method, all the $obj->$column_name
> methods, the $obj->get($column_name) and $obj->_attr(@cols)
> methods. None of these methods will actually retrieve values.
Have you declared the columns? Each class will need at least one
declaration of the form:
Class->columns(Primary => qw/id/);
Class->columns(Essential => qw/title colour/);
Class->columns(All => qw/id title colour/);
it's in the docs under *Declare your columns.*
Pardon me if this is too obvious.
will
|
|
Re: Getting data out of objects
William Ross 20:56 on 27 Apr 2005
|