请大家帮我看看这个存储过程错在了什么地方 谢谢
CREATE OR REPLACE PROCEDURE HISORCL.USP_EMR2_test
(
CUR_RESULT OUT SYS_REFCURSOR
)
is
begin
with HISORCL.TMP_BL2_ZMBMBFL as select row_number() over(order by A.ZMBDM) as rownum1,
a.ID,a.ZMBDM,a.ZMBMC,a.CJSJ,a.CZYDM,a.CZYMC,a.JBDM,a.JBMC,a.KSDM,a.KSMC,a.LYBL,a.LYCLASS,
(CASE WHEN a.MBFL=0 THEN '区域' when a.MBFL=1 THEN '全院' when a.MBFL=2 THEN '科室' when a.MBFL=3 THEN '个人' end) as ZMBFL,
a.ISMB,(case when a.ISMB=1 THEN '子模板' ELSE '域模板' end) as ZMBTYPE FROM HISORCL.BL_ZMBZD a where a.JGDM='320582106010001' and a.MBFL ='2'
select * from HISORCL.TMP_BL2_ZMBMBFL where rownum>=-1 and rownum<=50 order by CJSJ DESC;
commit;
open CUR_RESULT for select 'T' as rst,'成功!' as msg from dual;
exception when others then
rollback;
pkg_data_jcsj.USP_SYS_LOG_SAVE('HISORCL.USP_EMR2_ZMB_PAGE',step_name||substr(sqlerrm,1,250));
open CUR_RESULT for select 'F' as rst, '保存数据失败!' as msg from dual;
end;
错误信息是:
PROCEDURE HISORCL.USP_EMR2_TEST 编译错误
错误:PL/SQL: ORA-00905: 缺失关键字
行:7
文本:with HISORCL.TMP_BL2_ZMBMBFL as select row_number() over(order by A.ZMBDM) as rownum1,
错误:PL/SQL: SQL Statement ignored
行:7
文本:with HISORCL.TMP_BL2_ZMBMBFL as select row_number() over(order by A.ZMBDM) as rownum1,
------解决方案-------------------- with 后面的虚表名称中间不能有点。HISORCL这个是SID吧,没有必要加上这个。