我正在尝试在oracle中创建一个布尔函数。但我得到以下错误:
线:3
专栏:20
错误:PLS-00103:遇到符号“(”
这是我想要执行的代码:
CREATE OR REPLACE Function ART.prueba
(
p_cuser in varchar(20)
) return boolean is
l_mstat swt500.m_stat%type := null;
l_factu swt500.f_actu%type := null;
Begin
Select m_stat , f_actu
into l_mstat, l_factu
from swt500
where c_empr = 59
and c_user = p_cuser
and c_codi = 401
and t_codi = 'PR';
return true;
End;
/
有人能帮助我吗?
答案 0 :(得分:2)
作为参数的varchar和varchar2不需要指定大小,丢失"(20)"在参数。
CREATE OR REPLACE Function ART.prueba
(
p_cuser in varchar
) return boolean is
l_mstat swt500.m_stat%type := null;
l_factu swt500.f_actu%type := null;
Begin
Select m_stat , f_actu
into l_mstat, l_factu
from swt500
where c_empr = 59
and c_user = p_cuser
and c_codi = 401
and t_codi = 'PR';
return true;
End;
/