很简单的存储过程一直提示错误:
PLS-00103: Encountered the symbol "NUMBER" when expecting one of the following:
:=.),@%default character
The symbol ":=" was substituted for "NUMBER" to continue.
按照错误提示,尝试如下两种改动都不管用。
在声明时 a inout NUMBER 改为 :a inout NUMBER,
使用输出变量时,a := b 改为 :a := b,
最后发现Oracle中没有inout,只有in out,代码改为:
CREATE OR REPLACE
procedure TESTS(a in out int,b in out int)
as
temp NUMBER(12);
begin
temp := a;
a := b;
b := temp;
end ;
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类型