Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dynamic parameter with cursoradapter
Message
From
26/03/2005 07:50:32
 
 
To
25/03/2005 00:10:56
General information
Forum:
Visual FoxPro
Category:
Client/server
Environment versions
Visual FoxPro:
VFP 8
OS:
Windows XP
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
00998757
Message ID:
00999272
Views:
13
>Hi Aleksey,
>
>I have a little special situation with parameters that I think is outside of the scope of that thread. Instead of:
>
>"field1=?m.param"
>
>I want to say
>
>"m.param" (where m.param is "field1=?m.param")
>
>I don't even know the field that will be queried until run-time. If I could use a macro in .selectcmd, it'd be great1
>
>"SELECT * FROM table1 WHERE &lcwhere"
>
>thanks
>
>bonnie

This is supported, but the macro is replaced the first time only
(at CA.CursorFill time or when the RV is opened);
result: then REQUERY() or CursorRefresh() commands are static.

VFPT ( Aleksey ) can implement this with the syntax
( currently this fire a error, then no backward issues are opened )
"SELECT * FROM table1 &?stringexpression"
with this the CURSORGETPROPERTY("SQL")=="SELECT * FROM table1 &?stringexpression"
and the macro is expanded at execute time ( REQUERY() or CursorRefresh()),
using the evaluated parameter stringexpression.

This have another important effect,
it allow a very usefull behaviour,
currently unsupported:
support literal parameters
Example:
z=1
"SELECT * FROM table WHERE x=&?LTRIM(STR(m.z))"
* with this, VFP send to the backend the command:
"SELECT * FROM table WHERE x=1"
Fabio
Previous
Reply
Map
View

Click here to load this message in the networking platform