Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update conflict
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Titre:
Update conflict
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01033855
Message ID:
01033855
Vues:
78
Hi everybody,

I'm having an error 1585 "Update conflict" and I'm not sure, if I can work around it.

I have a view based on two tables.
SELECT Trans_relateds.ctrans_relateds_pk, Trans_relateds.ctrans_fk,;
  Trans_relateds.crelateds_fk, Trans_relateds.iguarantor_flag,;
  Trans_relateds.iprimary_flag,;
  PADR(ALLTRIM(Names.cl_name)+", "+ALLTRIM(Names.cf_name)+" "+cm_initial,60) AS cname;
 FROM ;
     MMVISCOLLECT!TRANS_RELATEDS ;
    INNER JOIN mmviscollect!names ;
   ON  Trans_relateds.crelateds_fk = Names.cpointer_fk;
 WHERE  Trans_relateds.ctrans_fk == ( ?VP_CTRANS_FK );
   AND  (  Trans_relateds.iguarantor_flag > ( 0 );
   AND  Names.ialias_flag <> ( 1 ) );
 ORDER BY Trans_relateds.iprimary_flag DESC

DBSetProp(ThisView,"View","Comment","VP_CTRANS_FK")
DBSetProp(ThisView,"View","SendUpdates",.T.)
DBSetProp(ThisView,"View","BatchUpdateCount",1)
DBSetProp(ThisView,"View","CompareMemo",.T.)
DBSetProp(ThisView,"View","FetchAsNeeded",.F.)
DBSetProp(ThisView,"View","FetchMemo",.T.)
DBSetProp(ThisView,"View","FetchSize",100)
DBSetProp(ThisView,"View","MaxRecords",-1)
DBSetProp(ThisView,"View","Prepared",.F.)
DBSetProp(ThisView,"View","UpdateType",1)
DBSetProp(ThisView,"View","UseMemoSize",255)
DBSetProp(ThisView,"View","Tables","mmviscollect!trans_relateds")
DBSetProp(ThisView,"View","WhereType",3)
DBSetProp(ThisView,"View","ParameterList","VP_CTRANS_FK,'C'")

DBSetProp(ThisView+".ctrans_relateds_pk","Field","Comment","TRANS_RELATEDS TABLE PRIMARY KEY")
DBSetProp(ThisView+".ctrans_relateds_pk","Field","DataType","C(16)")
DBSetProp(ThisView+".ctrans_relateds_pk","Field","UpdateName","mmviscollect!trans_relateds.ctrans_relateds_pk")
DBSetProp(ThisView+".ctrans_relateds_pk","Field","KeyField",.T.)
DBSetProp(ThisView+".ctrans_relateds_pk","Field","Updatable",.T.)

DBSetProp(ThisView+".ctrans_fk","Field","Comment","TRANS TABLE FOREIGN KEY - PATIENT VISIT RECORD TABLE")
DBSetProp(ThisView+".ctrans_fk","Field","DataType","C(16)")
DBSetProp(ThisView+".ctrans_fk","Field","UpdateName","mmviscollect!trans_relateds.ctrans_fk")
DBSetProp(ThisView+".ctrans_fk","Field","KeyField",.F.)
DBSetProp(ThisView+".ctrans_fk","Field","Updatable",.T.)

DBSetProp(ThisView+".crelateds_fk","Field","Comment","FOREIGN KEY TO RELATEDS TABLE")
DBSetProp(ThisView+".crelateds_fk","Field","DataType","C(16)")
DBSetProp(ThisView+".crelateds_fk","Field","UpdateName","mmviscollect!trans_relateds.crelateds_fk")
DBSetProp(ThisView+".crelateds_fk","Field","KeyField",.F.)
DBSetProp(ThisView+".crelateds_fk","Field","Updatable",.T.)

DBSetProp(ThisView+".iguarantor_flag","Field","Comment","IS THIS RELATED PERSON THE PATIENT'S GUARANTOR ON THIS ACCOUNT?")
DBSetProp(ThisView+".iguarantor_flag","Field","DataType","I")
DBSetProp(ThisView+".iguarantor_flag","Field","UpdateName","mmviscollect!trans_relateds.iguarantor_flag")
DBSetProp(ThisView+".iguarantor_flag","Field","KeyField",.F.)
DBSetProp(ThisView+".iguarantor_flag","Field","Updatable",.T.)

DBSetProp(ThisView+".iprimary_flag","Field","Comment","0 = Not primary guarantor, 1 = Primary guarantor")
DBSetProp(ThisView+".iprimary_flag","Field","DataType","I")
DBSetProp(ThisView+".iprimary_flag","Field","UpdateName","mmviscollect!trans_relateds.iprimary_flag")
DBSetProp(ThisView+".iprimary_flag","Field","KeyField",.F.)
DBSetProp(ThisView+".iprimary_flag","Field","Updatable",.T.)

DBSetProp(ThisView+".cname","Field","DataType","C(60)")
DBSetProp(ThisView+".cname","Field","UpdateName","60)")
DBSetProp(ThisView+".cname","Field","KeyField",.F.)
DBSetProp(ThisView+".cname","Field","Updatable",.F.)
The names fields are for display purpose only.

Now, I want to add a new record. I add a new record to Trans_Relateds, Relateds and Names. The first time I can save data, no problems. But the second time I'm getting an Update Conflict. I think, it could be due to the order I'm trying to save. First I'm saving the parent object, which is this view, then I'm saving relateds, then Names.

Do you see any way for me to overcome the problem? Perhaps I should go back to the original design, where we used two views (the second for display purpose only).

What do you think?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform