INNER JOIN ESDISTGS.TB_DIM_CURSO t2 ON t1.DS_ORIGEM = t2.DS_SISTEMA_ORIGEM
If t1.DS_ORIGEM is numeric and t2.DS_SISTEMA_ORIGEM is character, or the other way around, this will cause the SQL to fail and produce the error message shown. It doesn't have to be this condition, you have 4 INNER JOINS and 2 WHERE conditions that could cause this error, there is no way for me to determine which of these is the problem. You can check to find which of these variables are numeric and which are character, and then you can fix the problem.
... View more