Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Insert
Message
De
24/11/1999 09:13:42
 
 
À
24/11/1999 08:42:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Re: Insert
Divers
Thread ID:
00294887
Message ID:
00294968
Vues:
35
If the Members_Numbers and the Members_Info tables have a 1 to 1 relationship, you can create a view that combine the 2 tables joined with the Member_Number key and make every fields updatable. When adding a record, call the routine that generate the next Member_Number from your app (I suppose that the default value of the Member_Number field call this routine) and save this number to both fields in the view.

If you do not have a 1 to 1 relationship, then you need to add the record in the Members_Numbers table first, get the current record Member_Number value and add as many record you need in the Members_Info table. Note that getting the last record will fail in a multi-user scenario if another user has inserted a new record before you had the chance of getting the field value. The record pointer should be on the new record after an insert.

Then again, if you have a 1 to 1 relationship, that bring up the question: why not combining the 2 tables into one?

May I ask what is bothering you about having to do these steps to save your records?
>Thanx! But How can I do this? With Inner Join?
>Let me explain a little bit..
>
>I have a table Named Members_Numbers who will create an automatic number, save password, AccesLevel and the email and another one named Members_Infos who will contain others informations about the members...(Street adress, etc..)
>
>The number created automaticaly will be the member number.. I need it to add the others info in Members_Infos. A relation is set between Members_Number and Members_Infos with the Memer_Number fields...
>
>So.. when the user push the submit button, I have to insert informations in two tables... I found how with an Inster in Members_Numbers, select the last record of Members_Number then get the Number and another insert in Members_Infos.. Then 3 query to add :((
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform