I have this SQL Code. It just runs fine when i run this from the SQL Developer. I have a need to execute from my groovy script
sql.executeInsert("INSERT INTO s_status (C_DATE, sl_id, st_id, PARENT_st_id, STATUS, DETAILS, ACTIVE_IND) SELECT cd.cc_date, sl_id, st_id+1 st_id, st_id parent_st_id, 'CONFIRMED' status, 'SQL' details, 'Y' active_ind FROM s_status ss JOIN v_c_dates cd ON 1=1 WHERE (sl_id, st_id) IN (SELECT sl.sl_id, MAX(st_id) st_id FROM s_status ss JOIN stats sl ON ss.sl_id = sl.sl_id JOIN site si ON si.site_id = sl.site_id JOIN orders d ON d.ord_id = si.ord_id GROUP BY sl.sl_id ) and ss.active_ind = 'N' and ss.status = 'SENT'")
I see this error in my groovy console when i run this from groovy. Help me figuing the error
java.sql.SQLException: ORA-00933: SQL command not properly ended