+ -
当前位置:首页 → 问答吧 → 关于在eclipse的data source explorer上连接oracle 11g数据库的存储过程问题

关于在eclipse的data source explorer上连接oracle 11g数据库的存储过程问题

时间:2011-10-04

来源:互联网

连接上数据库了 一般的sql语句也没有问题
但是创建存储过程的时候就出问题了
SQL code
create or replace procedure myproc1(a out int)
is
begin
    select count(*) into a from aa;
end;

执行的时候可以顺利返回。
并且在eclipse上也可以看到这个存储过程
但是一调用就出错
SQL code
declare
num int:=1;
begin
    myproc1(num);
    dbms_output.put_line(num);
end

错误提示:
declare
num int:=1

ORA-06550: 第 2 行, 第 10 列: 
PLS-00103: 出现符号 "end-of-file"在需要下列之一时:
 * & = - + ; < / >
  at in is mod remainder not rem <an exponent (**)>
  <> or != or ~= >= <= <> and or like like2 like4 likec between
  || multiset member submultiset


Elapsed Time: 0 hr, 0 min, 0 sec, 0 ms.

并且我用sqlplus登录进去查看的时候发现找不到这个存储过程。。。
折腾了一晚上了 实在是受不了鸟。。。
大哥大姐们 以上是小弟遇到的问题,帮忙解决一下,不胜感激!!!

作者: moth001   发布时间: 2011-10-04

檢查一下eclipse中的連接用戶和存儲過程的所有者用戶是否同一用戶

作者: nGX20080110   发布时间: 2011-10-04

连接用户是sys as sysdba
sys创建存储过程并也用这个用户调用

作者: moth001   发布时间: 2011-10-04

不管什麼原因,最好不要在sys上建立任何object。
你試一下其他用戶看行不?

作者: nGX20080110   发布时间: 2011-10-04

declare
num int

ORA-06550: 第 2 行, 第 7 列: 
PLS-00103: 出现符号 "end-of-file"在需要下列之一时:
 := . ( @ % ; not
  null range default character


Elapsed Time: 0 hr, 0 min, 0 sec, 0 ms.

还是一样的错误

作者: moth001   发布时间: 2011-10-04

那你不要用eclipse了,用sqlplus試試吧

作者: nGX20080110   发布时间: 2011-10-04

Think you all the same!

作者: moth001   发布时间: 2011-10-04