NEWBIE problem with SQL

From: Marco <ilax33_at_hotmail.com>
Date: Tue, 17 Oct 2000 07:57:06 GMT
Message-ID: <mDTG5.31386$Nz.953664_at_news.infostrada.it>


Hi to All!
I've a big problem... becouse i'm new to SQL. I'm doing my first database using a Master - Detail relationship.

My database has two tables:
1) MasterProducts
2) DetailProducts

MasterProducts has:
NUM integer (unique field incremented with a trigger), CODE1 varchar,
CODE2 varchar

DetailProducts has:
NUM integer (unique field incremented with a trigger), NUM_IN_MASTER integer (the link to the Master Table) NAME varchar,
DESCRIPTION varchar

I use the Master-Detail becouse i need to store the products in many language. So, in the future i will ad many DetailProducts table, one for english, one for spanish, on for italian and so on.

THE PROBLEM:
What i've to write in SQL for insert a new product?

When a new product is insert to the database, i think that my SQL should write the CODE1 and CODE2 to the
Master Product table, the trigger should write to NUM the new value (incremented by one) , then append a new record in DetailProducts, write the NUM values of MasterProducts to the NUM_IN_MASTER of the appended record in Detail Products, and write the NAME and DESCRIPTION.

Please help me, i don't have any idea on how to make this.

Thanks!! Received on Tue Oct 17 2000 - 09:57:06 CEST

Original text of this message