当我尝试创建这样的存储过程时:
create or replace
procedure USR_Trial
( auth out usrr.DEPARTMENT
)
AS
BEGIN
select authority_id
into auth
from usrr where user_id='G68EF610';
END USR_Trial;
我收到以下错误:
Error(2,1): PLS-00488: invalid variable declaration: object 'USRR.DEPARTMENT' must be a type or subtype
我该如何解决这个问题?
答案 0 :(得分:6)
如果usrr.DEPARTMENT是表中的列,并且您希望OUT参数与该列具有相同的数据类型,则语法为:
create or replace
procedure USR_Trial
( auth out usrr.DEPARTMENT%type
)
...