2011-03-08 67 views
1

当我尝试创建这样一个存储过程:在Oracle中创建一个存储过程抱怨无效的变量声明

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

我怎样才能解决这个问题?

回答

6

如果usrr.DEPARTMENT是在一个表中的列,你想OUT参数是相同的数据类型为列,则语法是:

create or replace 
procedure USR_Trial 
(auth out usrr.DEPARTMENT%type 
) 
... 
相关问题