General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Strange SQL ICASE or IIF Behaviour
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only