leo_qiu_s
2019-08-01 19:14
采纳率: 66.7%
浏览 604

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条回答 默认 最新

  • 逆水行舟如何 2019-08-01 20:30
    已采纳

    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;

    打赏 评论

相关推荐 更多相似问题