johnf wrote:
> On Friday 24 August 2007 08:25, Uwe Grauer wrote:
>> johnf wrote:
>>> I dislike the select statement to getfields the most because I can see
>>> creating a table without needing a pkid. Last night Larry and I
>>> attempted to provide better select statements but failed. I will
>>> continue to review these select statements and will try to get help from
>>> the Postgres guys.
>> What is a table without a primary key good for?
>> Can you come up with a practical use for this?
>>
>> Uwe
>
> I sometimes create table of list items (normally just a string).
>
> listitem1
> listitem2
> listitem3
>
> I then use the table to populate pulldowns.
>
> I did simple stuff like this in VFP. I could have added a PK but it was not
> required all it did was provide a static list. But if the client wanted to
> add or change the list I had ability to make changes immediately without
> change code.
How about:
create table EnumerationTypes
{
pkid Numeric(18,0) not null,
EnumToken Varchar(100) not null,
EnumValueStr Varchar(200) bot null,
...
primary key ( pkid )
);
create table EnumerationEntries
{
pkid Numeric(18,0) not null,
EnumToken Varchar(100) not null,
EnumValueStr Varchar(200) bot null,
...
sort_order Integer,
Etyp_pkid Numeric(18,0) NOT NULL,
primary key ( pkid )
);
There is a 1:n relation from EnumerationTypes to EnumerationEntries,
so EtypIID is a foreign key to EnumerationTypes.pkid
That's how i do this.
You could also add n:m relations for types and Entries to be able to
have sublists.
Uwe
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/dabo-dev/[EMAIL PROTECTED]