Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strange SQL ICASE or IIF Behaviour
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Strange SQL ICASE or IIF Behaviour
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01383962
Message ID:
01383962
Views:
107
Have observed some strange behaviour when setting up a View with the following Syntax:

SELECT ICASE(Tasks.t_assgn_by = ?vp_rem_emp, "TaskA", Tasks.t_assgn_to = ?vp_rem_emp, "TaskB", "TaskN" ) As TType,;
Tasks.t_id, Tasks.t_assgn_by, Tasks.t_assgn_to;
FROM km!tasks;
WHERE INLIST(?vp_rem_emp, Tasks.t_assgn_by, Tasks.t_assgn_to, 1) = .T.

If a Public Variable vp_rem_emp has not been set up, The Error: SQL: Column "field | variable" is not found (Error 1806) for vp_rem_emp occurs.

Setting up a Variable in the calling program (or Public if creating the View) seems to "trick" the View into working as desired.

(In this example, t_d, t_assign_by, t_assgn_to are all Integer Fields. Don't think Field types matter.)

Same Error appears regardless of SET ENGINEBEHAVIOR settings and also appears to occur for IIF Function.

Anyone dealt with this type of issue?
Next
Reply
Map
View

Click here to load this message in the networking platform