Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update Conflict
Message
De
10/10/2000 19:25:47
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Update Conflict
Divers
Thread ID:
00427633
Message ID:
00427633
Vues:
54
I became inspired by Jim Booth's book and decided to use a view for one of my edit screens. The view is a simple combination of two tables. I allow the edit screen to make changes and execute the following code on process.

**************************************************************************************
*** Save changes
**************************************************************************************
TABLEUPDATE(.T.,.T.,"MoveHistoryMaintenance")
REQUERY("MoveHistoryMaintenance")
ThisForm.Pageframecustom1.ActivePage = 1

When two or more move records for the same client were involved the Requery generated an Update Conflict error. I reasoned that this was because the Key field I had marked (using eview) was the client id and as this is a foreign key and therefore not unique I removed the check mark. This made the update scream at me about keys. Obviously, I am missing some very important conceptual information about views and updates.

Here is the sql code for the view as specified in eview:

SELECT Movehst.*, Home.h_full_nm FROM main!movehst LEFT OUTER JOIN main!home ON Movehst.home = Home.id WHERE Movehst.id = ?gnChildID AND NOT DELETED() = .T. ORDER BY Movehst.id, Movehst.in_date, Movehst.home

All fields except h_full_nm are marked updateable (I don't want the home name changed as that is maintianed elsewhere).

All help greatly appreciated

Terry
It is impossible to make programs idiot proof. Idiots are too cleaver.

MCP( Tcp/Ip )
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform