java - ORA-00933: SQL command not properly ended in a query that runs fine in SQL developer -


below code gives

ora-00933: sql command not ended

on

    private final string duplicate_sql_1="select abc, count(abc)"             +"from table_1"             +"where type= 'new'"             +"and trunc(update_date) = trunc(sysdate)"             +"group abc having count(abc)>1";  resultset rs = stmt.executequery(duplicate_sql_1); 

same query worked fine on oracle sql developer.

you missing spaces (you must have space @ end of each line except last or @ start of each line except first):

private final string duplicate_sql_1="select abc, count(abc) "         +"from table_1 "         +"where type= 'new' "         +"and trunc(update_date) = trunc(sysdate) "         +"group abc having count(abc)>1"; 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -