Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using expression in ORDER BY clause
Message
From
18/10/2001 13:40:16
 
 
To
18/10/2001 13:33:32
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00570371
Message ID:
00570395
Views:
23
>>>From VFP 7 help:
>>>
>>>Each Order_Item must correspond to a column in the query results and can be one of the following:
>>>...
>>>A numeric expression indicating the location of the column in the result table.
>>>
>>>However, the following program causes error
>>>
>>>SQL: Column 'NORDER' is not found.
>>>
>>>How to use expressions in ORDER BY clause ?
>>>
>>>
>>>norder = 1
>>>CREATE CURSOR test ( test c(1) )
>>>SELECT * from test ORDER BY (norder)
>>>
>>
>>SELECT * from test ORDER BY norder
>
>This causes the same error !!!
>
>
>PRIVATE norder
>norder = 1
>CREATE CURSOR test ( test c(1) )
>SELECT * from test ORDER BY norder
>
How about

SELECT * from test ORDER BY &norder

In ORDER BY xxxx, the xxxx doesn't represent a variable but is actually a part of the command. Character values are all interpreted as field names. Macro substitution should allow the variable to be interpreted as a numeric value and would be the only way to evaluate a variable in this clause.

Jay
Previous
Reply
Map
View

Click here to load this message in the networking platform