我这有一截动态SQL在存储过程中,运行一直报缺少关键字
ORA-00905: missing keyword,我排查应该就是这截sql,是真改不动了
SELECT
CASE WHEN '||RuleType||' = '预警规则' THEN
CASE WHEN upper('||UseableRule||') LIKE '%CONTROL_END_DATE%' THEN
WHEN '||RuleType||' = '提醒规则' THEN
'['||PROJECT_NAMEs||','||TO_CHAR(TRUNC(SYSDATE)- TRUNC(CONTROL_END_DATE))||']'
ELSE
'['||PROJECT_NAMEs||','||TO_CHAR(TRUNC(SYSDATE)- TRUNC(PLAN_END_DATE))||']' END
CASE WHEN upper('||UseableRule||') LIKE '%CONTROL_END_DATE%' THEN
'['||PERSON_Names||','||NODE_NAME||','||TO_CHAR(TRUNC(CONTROL_END_DATE)-TRUNC(SYSDATE))||',]'
ELSE
'['||PERSON_Names||','||NODE_NAME||','||TO_CHAR(TRUNC(PLAN_END_DATE)-TRUNC(SYSDATE))||',]' end END AS smsParams
FROM dual