我正在处理一个请求,我想我错过了一个子句,因为我有这个错误第1行出现错误:ORA-00933:SQL命令未正确结束
请求:
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
错误:
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
你基本上有这个:
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 (...);
在UPDATE
的可用语法变体中,我找不到任何类似的内容。
此外,您正在尝试将列access_code1
与返回两个列的子查询进行匹配。
UPDATE PEOPLE a
SET a.SURNAME = (
select b.SURNAME
from PEOPLE b
where b.NI.NO = a.NI_NUMBER
)
在…上更新account__balances_t set credit_limit='51200'内部联接account_t
语法不好-oracle不支持此处的"内部联接"。正确的语法是:
UPDATE table SET colum=expression [,column = expression ... ]
WHERE condition<br>
阅读此处:http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_10007.htm