ERROR at line 1: ORA-00933: SQL command not properly ended

asmae picture asmae · Jul 17, 2013 · Viewed 10.6k times · Source

i'm working on a request ,and i think i missed a clause because i having this error ERROR at line 1: ORA-00933: SQL command not properly ended

the request :

echo "update account_balances_t set credit_limit='51200' inner join account_t on account_t.poid_id0=account_balances_t.obj_id0  where access_code1 in (SELECT DISTINCT ACCESS_CODE1,REC_ID FROM  ACCOUNT_T A, ACCOUNT_PRODUCTS_T AP WHERE A.STATUS != 10103  AND A.ACCESS_CODE1 IS NOT NULL AND A.POID_ID0 = AP.OBJ_ID0 AND AP.PRODUCT_OBJ_ID0 = (SELECT POID_ID0 FROM PRODUCT_T WHERE NAME = 'IEW - Europe Daily Plan 1')); "|sqlplus -s `whoami`/`whoami`@$ORACLE_SID

the error :

SELECT DISTINCT ACCESS_CODE1,REC_ID FROM  ACCOUNT_T A, ACCOUNT_PRODUCTS_T AP WHERE A.STATUS != 10103  AND A.ACCESS_CODE1 IS NOT NULL AND A.POID_ID0 = AP.OBJ_ID0 AND AP.PRODUCT_OBJ_ID0 = (SELECT POID_ID0 FROM PRODUCT_T WHERE NAME = 'IEW - Europe Daily Plan 1'))
                                                                                                                                                                                                                                                                   *
ERROR at line 1:
ORA-00933: SQL command not properly ended

Answer

Álvaro González picture Álvaro González · Jul 17, 2013

You basically have this:

UPDATE account_balances_t
SET credit_limit='51200'
INNER JOIN account_t ON account_t.poid_id0=account_balances_t.obj_id0
WHERE access_code1 IN (...);

I can't find anything similar among the available syntax variations for UPDATE.

Also, you're attempting to match column access_code1 with a subquery that returns two columns.