1
我用用戶「user」連接到Oracle 10g數據庫,當我在DBA_ROLES上運行選擇時,它顯示結果沒有任何問題,但是當選擇在過程中時,它返回錯誤ORA -00942:表或視圖不存在Oracle對DBA_ROLES的選擇權限
是缺少一些權限的用戶?爲什麼有可能執行SELECT而不是將其包含在過程中?
SQL> SELECT COUNT(*) FROM DBA_ROLES;
COUNT(*)
----------
18
SQL> CREATE OR REPLACE PROCEDURE tst_role IS
v VARCHAR2(100);
BEGIN
v := '';
FOR rec IN (SELECT ROLE FROM DBA_ROLES) LOOP
v := rec.role;
DBMS_OUTPUT.put_line(v);
END LOOP;
END;
/
Warning: Procedure created with compilation errors.
SQL> show errors
Errors for PROCEDURE TST_ROLE:
LINE/COL ERROR
-------- -----------------------------------------------------------------
5/13 PL/SQL: SQL Statement ignored
5/30 PL/SQL: ORA-00942: table or view does not exist
6/3 PL/SQL: Statement ignored
6/8 PLS-00364: loop index variable 'REC' use is invalid
我發送給DBA,現在我的問題已修復,謝謝! – mcha 2013-02-28 17:15:09