Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Drop down tables

$
0
0
Hello,
I'm having some trouble with dropdown tables...

I want to make a POSTGRES db that can be used with openoffice base for a more user friendly interface, because the people that will be inserting data by hand have low pc qualification.

My problem is,
Table 1 (brand)
brand_id (PK and auto-increment int)
brand_designation (brand name UNIQUE varchar(250))
brand_descrption (text)
Table 2

Table 2 (shoes)
shoe_id (PK and auto-increment int)
brand_designation
shoe_size (int)
shoe_designation (text)


Since the db is to be used by random people i dont want them to add manually the brand name... So i created a table with all brands, but i want them to be able to add the brand name instead of the brand id to make it easier.

I found 2 ways to do it: make the brand.brand_designation PK and delete the brand.brand_id or just make it a UNIQUE autoincrement,
or using a trigger that verifys the name before insertion/update.

But, what i really wanted is a away to keep the brand_id as PK and not use a trigger. I want a realtionship between tables and make it possible for the user to insert brand_designation instead of brand_id.

At the end, that would be a dropdowntable in OObase.

If there is no way to do what i'm asking wich one of the 2 that i found is the best? I dont feel that good making brand_designation a PK, and i'm affraid that with trigger option that wont turn out on a dropdown when i go on OObase bc there is no realtionship.
Thankyou

Viewing all articles
Browse latest Browse all 13329

Trending Articles