Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2008
    Posts
    1

    Unanswered: dbms_xmlschema.registerSchema /ORA-01031: insufficient privileges

    function registerXSD (p_file_id number) return number
    is
    v_contents clob;
    v_file_name process_files.file_name%type;
    v_res integer;
    v_process_id process_files.process_id%type;
    begin
    select trim(lower(p.file_name)), p.contents, p.process_id
    into v_file_name, v_contents , v_process_id
    from process_files p
    where p.file_id = p_file_id;
    dbms_xmlschema.registerSchema(trim(lower(v_file_na me)), v_contents);
    return 1;
    end registerXSD;

    When start this function exception is ORA-01031: insufficient privileges

    If execute in sqlplus next block :


    declare
    v_contents clob;
    v_file_name process_files.file_name%type;
    v_res integer;
    v_process_id process_files.process_id%type;
    begin
    select trim(lower(p.file_name)), p.contents, p.process_id
    into v_file_name, v_contents , v_process_id
    from process_files p
    where p.file_id = p_file_id;
    dbms_xmlschema.registerSchema(trim(lower(v_file_na me)), v_contents);
    return 1;
    end registerXSD;

    It's OK.

    I can understand ? . Can halp me ?

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    privileges acquired via ROLE do NOT apply with PL/SQL procedures (anonymous blocks excepted.

    You can prove this to yourself by

    SQL> SET ROLE NONE
    & invoke your anonymous block; which will fail as the function did/does
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •