Oracle PL/SQL中的编译错误

Oracle PL/SQL中的编译错误,sql,function,oracle11g,Sql,Function,Oracle11g,我一直盯着这几个小时,试图弄清楚它为什么不能运行,并且看不到任何语法错误会阻止它编译,但是我仍然得到以下错误: Error(6,1): PL/SQL: SQL Statement ignored Error(22,7): PL/SQL: ORA-00933: SQL command not properly ended 我尝试创建的函数如下所示: create or replace function caps_get_Uoffer_count_BD(ayrc in varchar2 ,mcrc

我一直盯着这几个小时,试图弄清楚它为什么不能运行,并且看不到任何语法错误会阻止它编译,但是我仍然得到以下错误:

Error(6,1): PL/SQL: SQL Statement ignored
Error(22,7): PL/SQL: ORA-00933: SQL command not properly ended
我尝试创建的函数如下所示:

create or replace function caps_get_Uoffer_count_BD(ayrc in varchar2
,mcrc in varchar2)
return number
is
app_count number;
begin
select count(*)
from
(select distinct cap.cap_stuc,cap.cap_apfs , cap.cap_seqn from 
intuit.srs_cap cap 
,intuit.srs_apf apf 
,intuit.srs_ioi ioi 
where cap.cap_ayrc = ayrc
and cap.cap_mcrc = mcrc
and apf.apf_stuc = cap.cap_stuc 
and apf.apf_seqn = cap.cap_apfs 
and apf.apf_recd <= to_date('1501'||substr(ayrc,1,4),'DDMMYYYY')
and cap.cap_stuc = ioi.ioi_stuc
and cap.cap_mcrc = ioi.ioi_mcrc
and ioi.ioi_iodc ='PAPERLESS'
and cap.cap_stac like 'A%'
and cap.cap_idrc in ('U','UF','UI','UD','CFU','CFUF','CIUI','CIUF','CIUD','CIU','CFUI','CFUD'))
return(app_count);
end;
数据库是oracle11g。有人能帮忙吗


非常感谢

在查询末尾缺少分号;你也错过了进入应用程序的计数部分。那应该准确地说是一匹没有名字的马吗?