title: FoxPro immediate if (IIF) - Function name is missing ) error
body: <p>OK, based on the error message, you would think this is simple (and it probably is...).</p>
  
  <p>I'm using an IIF (immediate if) in a FoxPro 9.2 database to evaluate an expression and then perform one of two actions depending on how the expression evaluates (basically, if a record exists, update it; if not, insert it).</p>
  
  <pre><code>IIF(
      ((SELECT COUNT(*) FROM tblName 
      WHERE tblName.Fldname = 'FLDMy' AND tblName.rCode = '000004') &gt; 0), 
      (UPDATE tblName SET tblName.Desc = 'Me' 
      WHERE tblName.Fldname = 'FLDMy' AND tblName.rCode = '000004'), 
      (INSERT INTO tblName(Fldname, rCode, Desc) 
      VALUES ('FLDMy','000004','Me'))
      )
  </code></pre>
  
  <p>This always returns error: "Function name is missing )." Note that all the parentheses are matched, so it's not missing a ")" anywhere. The individual UPDATE and INSERT pieces work fine when run separately, so I suspect it's the expression (first statement in the IIF) that's the problem.</p>
  
  <p>I'm executing the SQL from a C# service, so I'd like to be able to do the check and action in a single call into the FoxPro database.</p>