Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using an Expression to Get the Field Name..
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00282481
Message ID:
00282760
Views:
15
>I'm trying to write some code which will Open a Table and Perform a SQL Statement On it using Paramters passed in, so nothing is Hardcoded/set at Design Time.
>
>My problem arrises when I try to use a SELECT statement, specifying the Fields I want to Select and the fields I wish to Compare in my WHERE Clause. If I pass a variable, (containing the field Name), it doesn't work, eg.
>
>SELECT m.MyField FROM m.MyTable INTO CURSOR curSQLCursor WHERE m.MyField LIKE 'Z%'
>

Try:
SELECT (m.MyField) FROM (m.MyTable) INTO CURSOR (curSQLCursor) WHERE (m.MyField) LIKE 'Z%'
I discussed this in detail in a thread yesterday.
>In the above Statement, it treats m.MyField as a Literal, instead of substituting it for the Value held by the m.MyField Variable.
>
>Any help appreciated.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform