I have an ID field in a PRODUCT table, now, suppose that I have 7 products with an ID of "100", what I want to do is to change the ID values of all the products with and ID of "100".
Everything I 've done until now hasn't worked.
First I tried this:
SELECT PRODUCT
SET ORDER TO TAG id ASCENDANT
GO TOP
IF SEEK(100,'PRODUCT') THEN
DO WHILE NOT EOF()
REPLACE product.id WITH someothervalue
SKIP
ENDDO
ENDIF
The above code doesn't seem to work as it only changes the first encountered record.
Then I tried to use:
SELECT PRODUCT
GO TOP
SCAN FOR product.id = 100
REPLACE product.id WITH someothervalue
ENDSCAN
This threw me the same results as before.
I also have used the REPLACE command with scope clauses like REST, NEXT, etc.
Any input about this would be really appreciated
Visual FoxPro1
|