开发者

creating a stored procedure in Oracle complain about invalid variable declaration

开发者 https://www.devze.com 2023-02-15 06:36 出处:网络
When I try to create a stored procedure like this: create or replace procedure USR_Trial ( auth out usrr.DEPARTMENT

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 
)
...
0

精彩评论

暂无评论...
验证码 换一张
取 消