Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
RI fails when restrict is put on updates
Message
De
07/04/1998 23:54:20
Fernando España
Alta Tecnologia En Informatica
Guatemala, Guatemala
 
 
À
07/04/1998 17:22:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00090299
Message ID:
00090337
Vues:
24
The problem with the restrict RI sentence is:

if you have a Master Table an A child Table, and the RI is restrict on update, when you insert or append blank a record in a child table and do not insert with a FK value, the RI Fails, becouse any value in the parent table is equal to the value qhat you are atempt to insert in your child table.

Example

Master Table
ID Description
1 First Record
2 second Record
3 another Record

if you do this:
Select Child Table
Append Blank
**In this moment the RI verify if any recod in the Master Table is equal to he value qhat you are insert in the Child table and generate a error.

You have to do this:

Inser into Child Table (ID) values (thisform.combo1.value)
the RI verify the value inserted and this is into the Master Table and all is OK.

Sorry with my English!

Spanish Version:

Cuando se define la integridad referencial de una tabla primaria a una secundaria, la llave primaria de la tabla principal, se convierte en una llave foranea en la tabla secundaria, esto significa que si el desencadentante de insertar esta a restringir, cualquier valor ingresado en la tabla secundaria sobre el campo que sirve de llave foranea, debera existir primero en la tabla primaria.

La mejor forma de hacerlo es utilizando el Comando Insert-SQl o creando un valor default en el registro de la tabla secundaria que haga referencia a la tabla primaria.
Fernando España
SQL Server Specialist
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform