0
SELECT * FROM SMFTABLE WHERE (Upper(SYMBOL) LIKE '%A%' );

The above query is giving an

ORA-00933: SQL command not properly ended exception

the query is built by the following code:

buff.append("SELECT * FROM ").append(smftable).append(" WHERE (Upper(" + (String) colNames).append(") LIKE '%").append(secString.toUpperCase()).append("%' );");
codeLover
  • 2,571
  • 1
  • 11
  • 27

1 Answers1

0

Remove ; from the end as JDBC does not require it. Try this once..

codeLover
  • 2,571
  • 1
  • 11
  • 27
  • 1
    Trailing semicolon should not break the query (I think). – Tim Biegeleisen Oct 29 '18 at 06:11
  • 1
    @TimBiegeleisen: yes it will, but with a different error message: https://stackoverflow.com/questions/10728377 –  Oct 29 '18 at 06:44
  • 2
    @a_horse_with_no_name I seem to recall using semicolon with JDBC and MySQL. From [this post](https://stackoverflow.com/questions/18941539/is-the-semicolon-necessary-in-sql) I learned that some drivers remove it, and others will fail with error. It is not necessary in all cases (I think). – Tim Biegeleisen Oct 29 '18 at 06:47
  • Yeah. I did try removing it but it didnt change the outcome i.e about the exception – mandava jaswanth Oct 29 '18 at 08:12