-
SQL queries
If I want to create an SQL query that uses a user entered variable (a field
name in a certain table) How do I do this? I've tried making a local variable
in this fashion
SELECT *;
FROM DB!TABLE;
WHERE TABLE.variablename =
and foxpro returns SQL: Column "VARIABLENAME" not found in DB
-
Re: SQL queries
Grant,
Here's one way:
lcMySelect = ;
"SELECT * FROM Db!Table " + ;
"WHERE Table." + cVariableName + " = ......."
&lcMySelect
--
Cindy Winegarden
Microsoft Certified Professional, Visual FoxPro
Duke Children's Information Systems
Duke University Medical Center
cindyw@duke.edu
"Grant" <Gmartin@nmbpd.com> wrote in message
news:38fb68f2$1@news.devx.com...
|
| If I want to create an SQL query that uses a user entered variable
(a field
| name in a certain table) How do I do this? I've tried making a
local variable
| in this fashion
| SELECT *;
| FROM DB!TABLE;
| WHERE TABLE.variablename =
|
| and foxpro returns SQL: Column "VARIABLENAME" not found in DB
-
Re: SQL queries
cVariablename="lastname"
cTable = 'People.dbf'
cFilter
SELECT * FROM (cTable) AS T WHERE T.&cVariablename = ?cFilter
-Anders
"Grant" <Gmartin@nmbpd.com> wrote in message
news:38fb68f2$1@news.devx.com...
>
> If I want to create an SQL query that uses a user entered variable (a
field
> name in a certain table) How do I do this? I've tried making a local
variable
> in this fashion
> SELECT *;
> FROM DB!TABLE;
> WHERE TABLE.variablename =
>
> and foxpro returns SQL: Column "VARIABLENAME" not found in DB
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks