Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Class::DBI --> usage of group Others in __PACKAGE__->columns

by Mask (Pilgrim)
on Aug 25, 2005 at 14:54 UTC ( #486575=perlquestion: print w/ replies, xml ) Need Help??
Mask has asked for the wisdom of the Perl Monks concerning the following question:

Dear monks. I have a question related to Class::DBI package. Is it usefull to declare all fields in __PACKAGE__->columns? I've declared primary keys and essential fields, that I am using.
__PACKAGE__->columns( Primary => qw{pk1}); __PACKAGE__->columns( Essential => qw{f1 f2 f3});
Do I need to declare the rest of fields. Is it usefull if i am not using them for anything?
__PACKAGE__->columns( Others => qw{of1 of2 of3});

Comment on Class::DBI --> usage of group Others in __PACKAGE__->columns
Select or Download Code
Re: Class::DBI --> usage of group Others in __PACKAGE__->columns
by davidrw (Prior) on Aug 25, 2005 at 15:04 UTC
    Shouldn't need to declare them at all if never used. The one caveat though would be to make sure that an INSERT statement can succeed without them -- e.g. if of1 is a NOT NULL column and does not have a default, then __PACKAGE__->create() statements are going to bomb.
      Thank you, davidrw. I am only reading from the database, no inserts or updates. Anyway, in case of some unexpected behaviour, I'll know where the problem can be. Thank you.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://486575]
Approved by holli
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (18)
As of 2015-01-30 15:02 GMT
Find Nodes?
    Voting Booth?

    My top resolution in 2015 is:

    Results (250 votes), past polls