Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to retrieve latest updated table records
Message
 
 
To
08/03/2006 10:55:16
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01102440
Message ID:
01102458
Views:
12
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--
Previous
Reply
Map
View

Click here to load this message in the networking platform