Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Syntax error in 9 that works in 7
Message
From
17/09/2005 08:54:59
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
17/09/2005 08:53:28
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01050380
Message ID:
01050579
Views:
13
>>>>>Not sure why it would ever work. I've never seen distinct written as a function the way you have, rather then as a keyword, like order by
>>>>>
>>>>>>This line of code works in VFP 7 but causes an error in VFP 9. What's the problem?
>>>>>>
>>>>>>select distinct(make) as make from car_type into cursor ccar_type order by make
>>>>>>
>>>>>>The error is 1808 - Message= SQL: ORDER BY clause is invalid.
>>>>>>
>>>>>>Calvin
>>>>
>>>>Perry,
>>>>It is not a function. However having parentheses there makes < g > "make" an expression column (and serves as a separator at command line). ie:
>>>>select (cust_id) from customer
>>>>select(cust_id) from customer
>>>>select top 1(emp_id) from orders group by 1
>>>>
>>>>Cetin
>>>
>>>Hi Cetin,
>>>in the VFP's grammar of VFP the spaces/tabs are ignored:
>>>
>>>? INT(1)
>>>? INT                     (1)
>>>
>>>? normalize("Distinc     (xx)")
>>>CREATE CURSOR byby (aa i)
>>>APPEND BLANK
>>>
>>>SELECT distinct (aa) aa FROM byby
>>>SELECT distinct(aa) aa FROM byby
>>>
>>>SELECT (distinct       (aa)) aa FROM byby
>>>
>>>FUNCTION distinct(x)
>>>  RETURN "distinct"
>>>
>>>
>>
>>Yes that's what I meant.
>>Cetin
>
>This fail too, because make is a expression:
>
>select distinct make as make from car_type into cursor ccar_type order by make
>
Fabio,
I know that:) OK since you gave me a chance to comment on I'd suggest Calvin to use "order by 1" style.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform