Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2003
    Posts
    1,074

    Unanswered: rights to a table in another schema, view creation

    I was trying to setup a VIEW which uses a table in another schema. I am able to query the table directly, but not create a view which uses it:

    Code:
    SQL> connect cstm@dev
    Enter password: ******
    Connected.
    SQL> select count(*) from acc.pser;
    
      COUNT(*)
    ----------
           296
    
    SQL> create or replace view myview as select * from acc.pser;
    create or replace view myview as select * from acc.pser
                                                          *
    ERROR at line 1:
    ORA-01031: insufficient privileges
    Just in case I hadn't properly granted the ability to create VIEWs, I checked that out as well, and there's no problem.
    Code:
    SQL> create or replace view myview as select * from dual;
    
    View created.
    --=Chuck

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    What happens when you do as follows?

    connect cstm@dev
    SET ROLE NONE
    select count(*) from acc.pser;
    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.

  3. #3
    Join Date
    Dec 2003
    Posts
    1,074
    Code:
    SQL> set role none;
    
    Role set.
    
    SQL> select count(*) from acc.pser;
    select count(*) from acc.pser
                                *
    ERROR at line 1:
    ORA-00942: table or view does not exist

  4. #4
    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 within PL/SQL named procedure.
    Guess what CREATE VIEW really is?
    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.

  5. #5
    Join Date
    Dec 2003
    Posts
    1,074
    PL/SQL. I guess I thought it only applied to FUNCTIONs, PROCEDUREs, etc. But then they're also created by a CREATE OR REPLACE ...

  6. #6
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    direct GRANT on acc.pser is required
    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.

  7. #7
    Join Date
    Dec 2003
    Posts
    1,074
    Yup. Same answer to a similar question I had last week. Didn't want to believe it this time, though. Thanks for the help again. --=cf

Posting Permissions

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