General information
Category:
Coding, syntax & commands
Title:
IIF and FSIZE in SELECTs
I want to create a cursor with known fields from one with unknown fields. Suppose cursor In does *not* have the field myField:
When I try:
SELECT IIF(FSIZE('MYFIELD','In')=0,'Default',In.myfield) AS outfield;
FROM In INTO CURSOR Out
I get "SQL field myfield not found"
However, if I leave out the alias:
SELECT IIF(FSIZE('MYFIELD','In')=0,'Default',myfield) AS outfield;
FROM In INTO CURSOR Out
...it works.
I'm nervous about this. Is it robust to use the second technique?
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