Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to retrieve latest updated table records
Message
 
 
À
08/03/2006 10:55:16
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01102440
Message ID:
01102458
Vues:
11
See http://www.craigberntson.com/Articles/kb006.htm

>zDatapath = '\\myserver\mydatadir\'
>zDeptCode='12'
>
>SELECT * FROM &zDataPath.myTable ;
>WHERE schoolcode=zDeptCode ;
>INTO CURSOR xTemp
>
>GO BOTTOM
>IF NOT EOF()
> xSubRefno=xTemp.SubRefno+1
>ELSE
> xSubRefno=1
>ENDIF
>
>I need to get the next sequential myTable.subRefNo for a new record I'm appending. But xTemp cursor created with the SELECT statement does not dependably give me the latest updated record though. Many times, a new record appended (& TABLEUPDATEd) just before the codes above is executed, is not reflected in xTemp cursor -- the result being that I get an incorrect SubRefno & when the program tries to save a new appended record with SubRefno -- I get uniqueness of index error because I have duplicate subRefno. Does not happend all the time though -- but most of the time. Sometimes I do get the latest updated table records. Can any body help? Thanks all!
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform