<bdo id='ZzgHq'></bdo><ul id='ZzgHq'></ul>

  1. <i id='ZzgHq'><tr id='ZzgHq'><dt id='ZzgHq'><q id='ZzgHq'><span id='ZzgHq'><b id='ZzgHq'><form id='ZzgHq'><ins id='ZzgHq'></ins><ul id='ZzgHq'></ul><sub id='ZzgHq'></sub></form><legend id='ZzgHq'></legend><bdo id='ZzgHq'><pre id='ZzgHq'><center id='ZzgHq'></center></pre></bdo></b><th id='ZzgHq'></th></span></q></dt></tr></i><div id='ZzgHq'><tfoot id='ZzgHq'></tfoot><dl id='ZzgHq'><fieldset id='ZzgHq'></fieldset></dl></div>
    <legend id='ZzgHq'><style id='ZzgHq'><dir id='ZzgHq'><q id='ZzgHq'></q></dir></style></legend>
  2. <small id='ZzgHq'></small><noframes id='ZzgHq'>

    <tfoot id='ZzgHq'></tfoot>
    1. PL/SQL 在手动查询中权限不足

      PL/SQL insufficient privileges within a query manually possible(PL/SQL 在手动查询中权限不足)
        <bdo id='dQzs5'></bdo><ul id='dQzs5'></ul>

        1. <i id='dQzs5'><tr id='dQzs5'><dt id='dQzs5'><q id='dQzs5'><span id='dQzs5'><b id='dQzs5'><form id='dQzs5'><ins id='dQzs5'></ins><ul id='dQzs5'></ul><sub id='dQzs5'></sub></form><legend id='dQzs5'></legend><bdo id='dQzs5'><pre id='dQzs5'><center id='dQzs5'></center></pre></bdo></b><th id='dQzs5'></th></span></q></dt></tr></i><div id='dQzs5'><tfoot id='dQzs5'></tfoot><dl id='dQzs5'><fieldset id='dQzs5'></fieldset></dl></div>
        2. <legend id='dQzs5'><style id='dQzs5'><dir id='dQzs5'><q id='dQzs5'></q></dir></style></legend>

          <tfoot id='dQzs5'></tfoot>

                  <tbody id='dQzs5'></tbody>

              • <small id='dQzs5'></small><noframes id='dQzs5'>

                本文介绍了PL/SQL 在手动查询中权限不足的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我需要完成这个任务,并更新这个有很多行的表.

                I need to do this task , and update this table that has a lot of rows.

                此表有 2 列:

                FOOBAR

                我有 FOO 作为 PK,我知道这些值,它们都是数字,但我在 bar 上没有任何值.

                I have FOO as PK and i know those values, they are both numbers but i don't have any value at bar.

                我可以毫无问题地手动运行每个查询,但是我制作了这个 PL/SQL,因此一旦我需要在另一个查询中找到 BAR 值,它就会自动运行而没有任何问题.

                I can manually run every query without any problems, but i made this PL/SQL so it automatically run without any problem, once i need to find the BAR value within another query.

                create or replace procedure FxB_pro
                IS
                  tmpFIELD NUMBER := 0; 
                  i NUMBER := 0;
                  cursor c1 is  
                    SELECT * FROM FooXBar WHERE BAR IS NULL;
                BEGIN
                
                  FOR CTUpdate IN c1
                  LOOP 
                    BEGIN
                      SELECT t5.bar INTO tmpFIELD FROM table_1 t1, table_2 t2, table_3 t3, table_4 t4, table_5 t5, table_6 t6
                      where t1.fielda_id = t2.fielda_id
                      and t2.fielda_id = t3.fielda_id
                      and t3.fieldb_id = t4.fieldb_id 
                      and t3.fieldb_id = t6.fieldb_id
                      and t4.fieldd_id = t5.fieldc_id
                      and t1.fieldc = CTUpdate.FOO
                      and rownum = 1;
                    EXCEPTION
                      WHEN NO_DATA_FOUND THEN
                        tmpFIELD :=null;
                    END;
                
                    UPDATE FooXBar set BAR = tmpFIELD where FOO=CTUpdate.FOO;
                
                    i := i+1;
                
                    IF mod(i, 1000) = 0 THEN    -- Commit every 1000 records
                      COMMIT;
                    END IF;
                
                  END LOOP; 
                  COMMIT;
                END;
                

                我已经在我正确的测试环境中对此进行了测试,PL/SQL 已创建并运行,但是当我要在生产中运行它时,我在 Select 中遇到了这个错误tmpFIELD 中的值:

                I've tested this in my properly Test Environment the PL/SQL Is created and runs, but when i'm going to run it in Production , i have this error in the Select wich put the value in tmpFIELD :

                Erro(12,11): PL/SQL: SQL Statement ignored
                Erro(12,143): PL/SQL: ORA-01031: insufficient privileges
                

                我不明白为什么会这样,有人可以帮我吗?

                I can't figure why this is happening, can someone please help me?

                推荐答案

                您的权限是通过 ROLE 分配的.这适用于直接 SQL,但不适用于 PL/SQL.

                Your privileges are assigned via ROLE. This is fine with direct SQL, but don't work with PL/SQL.

                您需要直接为您的用户获取权限.

                You need to acquire the privileges direct to you user.

                同时测试预先设置的 PL/SQL 查询

                While testing the PL/SQL queries set in advance

                 set role none;
                

                这将停用通过 ROLE 获得的权限,并显示在 PL/SQL 中运行时可能出现的问题.

                this will deactivate the priviledges acquired via ROLE and show possible problems running in PL/SQL.

                这篇关于PL/SQL 在手动查询中权限不足的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                How to redirect the output of DBMS_OUTPUT.PUT_LINE to a file?(如何将 DBMS_OUTPUT.PUT_LINE 的输出重定向到文件?)
                How do I get column datatype in Oracle with PL-SQL with low privileges?(如何使用低权限的 PL-SQL 在 Oracle 中获取列数据类型?)
                Get a list of all functions and procedures in an Oracle database(获取 Oracle 数据库中所有函数和过程的列表)
                Why cannot I create triggers on objects owned by SYS?(为什么我不能在 SYS 拥有的对象上创建触发器?)
                Returning result even for elements in IN list that don#39;t exist in table(即使对于表中不存在的 IN 列表中的元素也返回结果)
                Reset Sequence in oracle 11g(oracle 11g 中的重置序列)

                <tfoot id='EJ6nF'></tfoot>
                  • <small id='EJ6nF'></small><noframes id='EJ6nF'>

                    <i id='EJ6nF'><tr id='EJ6nF'><dt id='EJ6nF'><q id='EJ6nF'><span id='EJ6nF'><b id='EJ6nF'><form id='EJ6nF'><ins id='EJ6nF'></ins><ul id='EJ6nF'></ul><sub id='EJ6nF'></sub></form><legend id='EJ6nF'></legend><bdo id='EJ6nF'><pre id='EJ6nF'><center id='EJ6nF'></center></pre></bdo></b><th id='EJ6nF'></th></span></q></dt></tr></i><div id='EJ6nF'><tfoot id='EJ6nF'></tfoot><dl id='EJ6nF'><fieldset id='EJ6nF'></fieldset></dl></div>
                        <tbody id='EJ6nF'></tbody>
                      <legend id='EJ6nF'><style id='EJ6nF'><dir id='EJ6nF'><q id='EJ6nF'></q></dir></style></legend>
                          <bdo id='EJ6nF'></bdo><ul id='EJ6nF'></ul>