creating a stored procedure in Oracle complain about invalid variable declaration
When I try to create a stored procedure like this:
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;
I get the following error:
Error(2,1)开发者_如何学运维: PLS-00488: invalid variable declaration: object 'USRR.DEPARTMENT' must be a type or subtype
How can I fix this?
If usrr.DEPARTMENT is a column in a table and you want the OUT parameter to be of the same datatype as that column then the syntax is:
create or replace
procedure USR_Trial
( auth out usrr.DEPARTMENT%type
)
...
精彩评论