Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The old EOF() and REPLACE gotcha
Message
From
19/10/1999 09:25:55
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
The old EOF() and REPLACE gotcha
Miscellaneous
Thread ID:
00278126
Message ID:
00278126
Views:
47
Hi All,

Went crazy with a REPLACE problem until I realized I was being bitten by an old problem. Thought I would post what was happening FYI:

Assume two tables, invheader and invdetail. invheader has 1 record and invdetail has none. The following statement won't work:

SELECT invdetail
REPLACE invheader.invno WITH "00001"

No replacement is made because the current alias, invdetail, is at EOF() (no records), even though invheader has a record and this is a valid statement. The following WILL work:

SELECT invheader
REPLACE invheader.invno WITH "00001"

Sometime this won't be as obvious as you won't have a SELECT statement to make the ALIAS() apparent.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Next
Reply
Map
View

Click here to load this message in the networking platform