Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Debug this SQL statement...
Message
From
03/04/1998 02:22:03
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
03/04/1998 00:37:07
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00089155
Message ID:
00089174
Views:
23
>Tell me whu this VFP code does not work:
>
>select (this.Field_List);
> from (this.table_name);
> order by (this.Order_By);
> into array (this.gaData)
>
>
>So therefore I had to go this route to get it to work:
>
>cField_List=this.field_list
>cOrder_By=this.order_by
>
>select &cField_List;
> from (this.table_name);
> order by &cOrder_By;
> into array this.gaData
>
>
>SQL doesn't seem to like (this.whatever)?
SQL also uses "this". But here the problem is with expressions. "Fieldlist" and "orderby" are not name expressions and thus you can't use () for them. For fieldlist when you use () then this.fieldlist would be an expression itself. You would get a column full of "this.fieldlist". The & operator is the only way to go here. Since tablename and destination are name expressions there is no problem there (also you wouldn't be able to use name expression in "where" clause).
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