比如代码如下:
oraclecommand ocmd=new oraclecommand();
ocmd.commandtext="sys.mypredure";
ocmd.commandtype=commandtype.predure;
ocmd.exeutenonquery();
会报错:
必须声明sys.mypredure标识符!
应该如何修改代码?
还有就是如何在存储过程中显式授予权限?
我用grant create any table to scott;
这句写在begin块中不对,应该写在哪?
还有就是这句:
create or replace predure scott.mypredure(owner in sys.dba_tables.owner%type,tablename in sys.dba_tables.table_name%type)
这句不对,
也提示:必须声明sys.dba_tables标识符!
我知道是授权的问题,但具体怎么授权?语句怎么写?写在哪啊?请高手指教!

解决方案 »

  1.   

    oraclecommand ocmd=new oraclecommand(); 
    ocmd.commandtext="sys.mypredure"; 
    ocmd.commandtype=commandtype.predure; 
    ocmd.exeutenonquery(); 
    补充一句:
    我的conn是用scott登录连接的。谢谢
      

  2.   

    要在存储过程里面执行授权语句?!用scott用户登陆,执行scott下面的存储过程,还要在存储过程里面给scott用户授权?!估计是不行的。
    授权这种事情,只要做一次就行了,没必要写在过程里面吧?
      

  3.   

    用sys登录执行以下语句: 
    grant select, insert, update, delete on dba_tables to scott; 
    还有,java的东东,本人不熟=,=
      

  4.   

    感觉好乱,这是代码的问题。sys.mypredure是管理员用户的proc,你用普通用户的权限登录连接好像不行。
      

  5.   

    为什么不在system用户下,直接给scott赋dba权限