来自非预期ora-00923的位置

dnph8jn4  于 2021-10-10  发布在  Java
关注(0)|答案(0)|浏览(300)

大家好,我正在尝试在jdbc服务器上创建一个包含用户变量和一些sql语句的报表。我一直收到错误“from not where expected ora-00923”。我在开发人员中尝试了sql,以查看是否可以捕获问题,但我似乎无法在代码中找到任何问题。任何帮助都将不胜感激

Below is the Nightly Summary for <{[begin_date(MM/DD/YYYY)]}> to <{SQL}>
    SELECT
        (CASE WHEN '<{[end_date(Optional)]}>' = 'Optional' THEN TO_CHAR(TO_DATE('<{[begin_date]}>', 'MM/DD/YYYY') + 1, 'MM/DD/YYYY') ELSE TO_CHAR(TO_DATE('<{[end_date]}>', 'MM/DD/YYYY'), 'MM/DD/YYYY') END)
    FROM
        dual
<{SQL}><{SQL(0,0)}>.

<h3>Completed Electric Events</h3>
<{TABLE(Event Type, Event Total)}>
 (SELECT 
 '<b>AMIPO</b>' as Event Type,
  NVL(NULLIF(TO_CHAR((SELECT COUNT(EventID) FROM electric_jobs 
  WHERE BeginDateTime BETWEEN TO_DATE('<{[begin_date]}>', 'MM/DD/YYYY') AND TO_DATE('<{SQL(0,0)}>', 'MM/DD/YYYY')
  AND (Typeclues LIKE '%AMIPO%')
  AND Analysis = 'Predicted Service Outage'
  AND Status = 'Completed')), '0'), ' ') as AMIPO
FROM 
dual) 

UNION ALL

(SELECT 
 '<b>BKR</b>' as Event Type,
  NVL(NULLIF(TO_CHAR((SELECT COUNT(EventID) FROM electric_jobs 
  WHERE BeginDateTime BETWEEN TO_DATE('<{[begin_date]}>', 'MM/DD/YYYY') AND TO_DATE('<{SQL(0,0)}>', 'MM/DD/YYYY')
  AND (UPPER(Device) LIKE '%BKR%')
  AND Analysis <> 'Real Momentary Outage'
  AND Status = 'Completed')), '0'), ' ') as BKR
FROM
DUAL) 

<{TABLE}>

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题