leo_qiu_s 2019-08-01 19:14 采纳率: 0%
浏览 674
已采纳

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;

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 优质github账号直接兑换rmb,感兴趣伙伴可以私信
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊
  • ¥15 安装svn网络有问题怎么办
  • ¥15 Python爬取指定微博话题下的内容,保存为txt
  • ¥15 vue2登录调用后端接口如何实现
  • ¥65 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)