I have just spent the night tryng to figure out why I kept getting the dreaded 'UCase' is not a recognized function name. when running an integration. I had set UseOptimizedFilter to False just like I have dozens of times. The query could not be much simpler
SELECT TRXDATE,Reference,Jrnl
FROM MYHEADERTABLE
ORDER BY TRXDATE,REFERENCE,JRNL for the header
and
SELECT TRXDATE,Reference,Jrnl,debitamt,crdtamnt
FROM MYDETAILTABLE
ORDER BY TRXDATE,REFERENCE,JRNL for the detail
After trying everything I changed the case of the ORDER BY clause to Order By TRXDATE,Reference,Jrnl so now the case on the order by matches the case of the fields and now the integration works. So apparently IM for GP 2013 is case sensitive when it comes to the field names. I have no idea what creates the call to the UCASE function. It is something internal to IM.