14:02:15 SQL> connect internal/oracle
已连接。
14:02:22 SQL> grant select on obj$ to temp;授权成功。
14:02:25 SQL> connect temp/temp
已连接。
14:02:38 SQL> declare
14:02:41 2 v_obj# number;
14:02:41 3 begin
14:02:41 4 select obj# into v_obj# from sys.obj$ where rownum=1;
14:02:45 5 end;
14:02:47 6 /PL/SQL 过程已成功完成。已用时间: 00: 00: 00.16
14:02:47 SQL>
已连接。
14:02:22 SQL> grant select on obj$ to temp;授权成功。
14:02:25 SQL> connect temp/temp
已连接。
14:02:38 SQL> declare
14:02:41 2 v_obj# number;
14:02:41 3 begin
14:02:41 4 select obj# into v_obj# from sys.obj$ where rownum=1;
14:02:45 5 end;
14:02:47 6 /PL/SQL 过程已成功完成。已用时间: 00: 00: 00.16
14:02:47 SQL>
解决方案 »
- 一个sql语句的问题
- oracle表的数据统计
- 帮帮我吧,我就想往表中添加数据。
- 为什么临时表和普通表的查询速度相差很多?
- 请问我在procedure中直接写 truncate table tablename为什么不通过
- 在oracle中如何查看记录(除了用SQL语句,有没有像SQL server一样的企业管理器可以查看的)
- 高手一定要来看看,帮解决问题
- select查詢的group by為變量怎麼辦?在線等,急!
- oracle把表都放哪了?
- 在存储过程中,通过链路从另一个数据库中取一个大表到本数据库,……………(100)
- 对一个5G的数据库文件*.ora,是不是在操作系统中不能直接复制?
- 如何update
在oracle中复制一个表是这样:
create table ta as (select * from sys.obj$);
create or replace function SF_SET_SEQ_NEXTVAL2(vcSeqName in varchar2, lNextVal in number) return number is
Result number;
lMinVal number;
lMaxVal number;
lIncVal number;
lCycle number;
lOrder number;
lCache number;
sCycle varchar2(10);
sOrder varchar2(10);
sCache varchar2(10);
begin
select s.increment$, s.minvalue, s.maxvalue, s.cycle#, s.Order$, s.cache
into lIncVal, lMinVal, lMaxVal, lCycle, lOrder, lCache
from sys.obj$ o, sys.seq$ s, sys.user$ u -- 在这里报错,说需要指明sys.obj$
where u.name = sys.login_user() and
u.user# = o.owner# and
o.name = upper(vcSeqName) and
o.obj# = s.obj#;
if lCycle = 0 then sCycle := 'nocycle'; else sCycle := 'cycle'; end if;
if lOrder = 0 then sOrder := 'noorder'; else sOrder := 'order'; end if;
if lCache <= 0 then
sCache := 'nocache';
else
sCache := 'cache '||lCache;
end if;...
我试了,不光obj$不行,seq$等表都不行,但是如果换成dual之类的表就没问题。
SQL> create or replace procedure p_test_refcur is
2 v_refcur PKG_RefCursor.Refcursor;
3 cursor cur is select * from sys.seq$;
4 begin
5
6 prc_Test_refcursor(v_refcur);
7 end p_test_refcur;
8 /Procedure created
俺对oracle并不是十分熟悉,请赐教一二。。
已连接。
14:02:22 SQL> grant select on obj$ to temp;授权成功。这就是显示赋权限。