qiudechao1
leo_qiu_s
采纳率66.7%
2019-08-01 19:14

Navicat连接Oracle,存储过程为什么提示错误?

已采纳

代码

create or replace procedure EXCHANGE(a inout number,b inout number) 
as 
temp number(10); 
begin 
temp:=a;
a:=b; 
b:=temp; 
end;

一直提示如下错误:

PLS-00103: Encountered the symbol "NUMBER" when expecting one of the following:
:=.),@%default character
The symbol ":=" was substituted for "NUMBER" to continue.

图片说明

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • weixin_43823423 逆水行舟如何 2年前

    oracle的存储过程和mysql的写法不一样的,下面这么写是mysql的写法
    create procedure tests(inout a int,inout b int)
    begin
    declare temp int;
    set temp = a;
    set a = b;
    set b= temp;
    end ;

    补充一下,mysql没有number类型

    oracle应该这么写的
    create or replace procedure test_aa(a in out number, b in out number)
    is

    temp number(10);

    begin
    temp := a;
    a := b;
    b := temp

    end;

    点赞 评论 复制链接分享

为你推荐