>SELECT MyRealTable.* ; > FROM MyRealTable ; > JOIN MostRecentCopy ; > ON MyRealTable.PK = MostRecentCopy.PK ; > WHERE MyRealTable.Field1 <> MostRecentCopy.Field1 ; > OR MyRealTable.Field2 <> MostRecentCopy.Field2 ; > .... ; > INTO CURSOR csrNewChanges >>
lcCurr = lcDrive + 'Masters\' + tcFileType + '_CURR.dbf' lcMRC = lcDrive + 'Masters\' + tcFileType + '_MRC.dbf' lcFieldComparisonList = fieldlist(lcCurr, tcExpList) SELECT 'U', tc.* ; FROM (lcCurr) tc ; JOIN (lcMRC) tp ; ON tc.PK = tp.PK ; WHERE &lcFieldComparisonList. ; INTO CURSOR curUpd return FUNCTION fieldlist(tcFileName, tcExpList) LOCAL i, retparm, lcFileType, lcPrefix, lcExpList lcExpList = tcExpList + ',adduser,adddate,addtime,lckuser,lckdate,lcktime' lcFileType = IIF(PCOUNT() = 0, '', tcFileType) lcPrefix = '' retparm = '' FOR i = 1 TO FCOUNT() IF FIELD(i) $ lcExpList LOOP ENDIF retparm = retparm + lcPrefix + 'tc.' + FIELD(i) ; + ' <> tp.' + FIELD(i) lcPrefix = ' OR ' NEXT RETURN retparmI'm getting an error that the SQL statement is too long, probably because there are so many fields to process. How can I solve this?