Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP new bug: UPDATE with SET RELATION fails
Message
From
02/12/2001 12:27:49
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
02/12/2001 10:42:17
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00588420
Message ID:
00588512
Views:
24
>The same problem is with SQL SELECT statement.
>
>use mytable in 0
>select recno('mytable') from mytable
>
>produces constant recno() values.
>
>However, if mytable is not opened prior to select:
>
>use in mytable
>select recno('mytable') from mytable
>
>recno() works correctly !
>
>Does'nt this smell like another bug ?

Yes and no. There's a general rule in SQL Select (and it obviously applies to SQL Update) that it uses the tables AGAIN internally, so any function which uses aliases will produce a result based on the alias outside the SQL statement, and not the one used inside. So, it will behave as a constant, because while the statement is executing, nothing is happening in that alias - record pointer doesn't move.

One thing I tried was to use internal aliases instead, but then while the statement is parsed, this alias doesn't exist yet, it's there only syntactically, for the private use of the parser.

select recno("lalias") from mytable lalias into cursor temp

gives "Alias is not found." error message. So, using EOF("somealias") will give you the status of that alias outsode of the SQL statement.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform