Warm tip: This article is reproduced from serverfault.com, please click

ORA 00933 : SQL Command not properly ended with IN operator in oracle

发布于 2020-12-01 07:45:02

I am trying to execute a query which is as follows

update L2l_Lov_Master set QUERY_STRING = 'com.jmr.profitto.los.app.retail.model.L2LLdmLeadinformation entity WHERE entity.status IN ('NEW','REJECTED','REJECTED_BY_CUSTOMER')' where LOV_ID = 'customerLov-leadcode';

I am using oracle DB and i am getting "ORA 00933: SQL command not properly ended". Need to know where it went wrong

Questioner
FIFA oneterahertz
Viewed
0
670k 2020-12-02 01:14:56

As far as I can tell, you problem is related with the quotes --> to be more explicit, you have a problem when your IN clause starts because you close your first quote from query string

query_string = 'com.jmr.profitto.los.app.retail.model.L2LLdmLeadinformation entity WHERE entity.status IN ('

I think you need to encapsulate the quotes from the IN clause so that they get ignored by the first query.

UPDATE l2l_lov_master
SET
    query_string = 'com.jmr.profitto.los.app.retail.model.L2LLdmLeadinformation entity WHERE entity.status IN (''
new '','' rejected '','' rejected_by_customer '')'
WHERE
    lov_id = 'customerLov-leadcode';