问题1: create user username identified by passwd; grant execute on procname to username; grant select on tablename to username;
1、见ruyuezhang(ruyue) 的回复 2、可以,用游标就行。 在包中定义游标 CREATE OR REPLACE PACKAGE "TEST"."PK_TEST" AS TYPE mycursor IS REF CURSOR; end; 建立返回游标的存储过程 CREATE OR REPLACE PROCEDURE "TEST"."SP_TEST" (cur_lag out pk_test.mycursor) as 3、select (sysdate-1/12) from dual; 4、ALTER USER "SYSTEM" IDENTIFIED BY "aa"
select owner from all_tables where tablename='大写的表名' -------------------------------------------------------- 看看表的所有者 用ruyuezhang的语句应该没问题的 create user username identified by passwd; grant execute on procname to username; grant select on tablename to username 注意大小写; 查询其他用户所属的表,前缀加上用户名.
上面的SQL写错了,应该是table_name. select owner from all_tables where table_name='大写的表名'
表的所有者是xxx,我用grant select on tablename to yyyyy为新添加的用户然后我用yyy登陆后不能从tablename中取数据
create user username identified by passwd;
grant execute on procname to username;
grant select on tablename to username;
2、可以,用游标就行。
在包中定义游标
CREATE OR REPLACE PACKAGE "TEST"."PK_TEST" AS
TYPE mycursor IS REF CURSOR;
end;
建立返回游标的存储过程
CREATE OR REPLACE PROCEDURE "TEST"."SP_TEST"
(cur_lag out pk_test.mycursor)
as
3、select (sysdate-1/12) from dual;
4、ALTER USER "SYSTEM" IDENTIFIED BY "aa"
scott倒无所谓,反正也没有多大的权限
关于问题2有一点不明白:我要把得到的游标作为变量传给另一个存储过程是否可以?如果可以的话,另一个存储过程如何遍历游标并将结果写入一个表中,谢谢!
用户不能登陆是因为它没有CREATE SESSION的权限.
以SYS用户登陆,然后赋予这个用户CONNECT 角色就可以了.
select owner from all_tables where tablename='大写的表名'
--------------------------------------------------------
看看表的所有者 用ruyuezhang的语句应该没问题的
create user username identified by passwd;
grant execute on procname to username;
grant select on tablename to username 注意大小写;
查询其他用户所属的表,前缀加上用户名.
select owner from all_tables where table_name='大写的表名'