[ic] single column tables
Dan B
db@cyclonehq.dnsalias.net
Sat, 05 May 2001 15:38:05 -0700
At 10:44 AM 5/5/2001 -0400, you wrote:
>Quoting bill@worldwideimpact.com (bill@worldwideimpact.com):
> > IC 4.7.1 Vend/Table/DBI.pm Line 323
> >
> > die "DBI: no column names returned for $tablename\n"
> > unless defined $config->{NAME}[1];
> >
> > Why must a table have at least two columns?
> >
>
>I guess that is a good question. But I don't know the answer....never
>seen the need for a key-only list before. 8-)
Some people build tables without keys. Think states:
WA
OR
UT
...
(Except apply to an example where the single column table had thousands or
millions of rows). It usually comes up when you know you will always
select the entire list (no WHERE clauses), and for some reason need to keep
it in the database (verses an in-memory or other convenient method).
That said, I still recommend adding a primary key anyway. (What's a few
bytes per row going to cost, anyway?)
Dan Browning, Cyclone Computer Systems, danb@cyclonecomputers.com