javamysqlpentahoora-00933

newbe Pentaho: java.sql.SQLSyntaxErrorException: ORA-00933:


I know there are some answers to this error. I know it's a syntax error, but can't fix it!! I'm running these commands in a Pentaho transformation. They are from one DB to another.

SELECT emp, codlug, nombre, pais, pcia, codp  FROM CONDOR.TCODLUG 
order by codlug desc


select *
FROM CONDOR.TCABTRAN o138195,
      CONDOR.TCRES o138205,
      CONDOR.TCCTES o138234,
      CONDOR.TITEMS o138320,
      CONDOR.TPDC o138351,
      CONDOR.TPROV o138355,
      CONDORBI.VRENTRAN o138514,
      CONDOR.TROCCONT o138537
WHERE ( (o138195.EMP = o138514.EMP AND o138195.CODTRAN = o138514.CODTRAN AND o138195.NUMTRAN = o138514.NUMTRAN)
   and (o138205.EMP(+) = o138514.EMP AND o138205.UNORG1(+) = o138514.UNORG1 AND o138205.UNORG2(+) = o138514.UNORG2 AND o138205.UNORG3(+) = o138514.UNORG3)
   and (o138234.EMP(+) = o138514.EMP AND o138234.CODCC(+) = o138514.CODCC AND o138234.NUMCC(+) = o138514.NUMCC)
   and (o138320.CODITEM(+) = o138537.CODITEM)
   and (o138351.CTACONT = o138514.CTACONT)
   and (o138355.EMP(+) = o138537.EMP AND o138355.NUMPROV(+) = o138537.NUMPROV)
   and (o138537.EMP(+) = o138514.EMP AND o138537.CODTRAN(+) = o138514.CODTRAN AND o138537.NUMTRAN(+) = o138514.NUMTRAN AND o138537.RENGLON(+) = o138514.RENGLON))
   AND ((DECODE(o138351.ACRES,1,'C.Res',NULL)) = 'C.Res')
 --  AND (o138514.CTACONT BETWEEN :"Cuenta Desde" AND :"Cuenta Hasta")
 --  AND (o138514.FECREG BETWEEN :"Desde" AND :"Hasta")
 --  AND (o138514.EMP = :"Empresa")

When I run the transformation it throws the syntax error:

java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended

i´ve already search but can´t find a proper answer. THNAKS!!!


Solution

  • You can have only one statement in the input table.

    Well, you can have more, provided that they are separated by ";". However only the last one will produce rows in the output. (This feature is there to make temporary tables or procedures to execute on the last statement).

    If you want a union, and do not want to do it in sql, then make two table input steps and drop those two in the same PDI step. You'll get an error if the metadata (column names, order and types) are not the same.enter image description here