Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updating Cursor with Replace Command
Message
From
21/09/2017 17:39:17
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Updating Cursor with Replace Command
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8.1
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01654486
Message ID:
01654486
Views:
80
Dear Sir,
I am using the following code to update a Row Position (POSR) in a Cursor
Select Distinct POSR From PAGETWO Order By POSR Desc Into Cursor DISTINCTPOSR
				nCD=12
					Scan
					nPagetwoDistinctposR=POSR
					Select PAGETWO
					nCOMMONDIFFERENCE=m.T-nCD
					Replace All POSR With nCOMMONDIFFERENCE For POSR=nPagetwoDistinctposR
					Select DISTINCTPOSR
					nCD=nCD+12
				ENDSCAN
Using the above code at first instance my POSR is changed by Desired value say from 696 to 453.

However, In the scan loop if the value of nPagetwoDistinctposR again comes to 453 by chance, it again updates my cursor to new value.

For the above I have a solution to insert another Like Yes/NO etc but I am seeking for some simple solution and Better Code or a SQL that may work faster For the above.

Pls Guide
Regards
Harsh
Next
Reply
Map
View

Click here to load this message in the networking platform