Accesing another user's Table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lakshman1820
    New Member
    • May 2007
    • 1

    Accesing another user's Table

    Hi Friends,

    I am able to access a table created by USER2 when i write some select query.

    But when i use the same select query inside a Package iam getting a error that table or view does not exist.

    Please give me a solution to use that tables inside the package
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    since u r not the owner user ucan't directly select from other users table.

    method1:--grant prevelidges from the other user to the current user.

    mehod2:--use a dblink which connects to the second user.


    Hope this helps you.

    Comment

    • Medhatithi
      New Member
      • Mar 2007
      • 33

      #3
      Originally posted by debasisdas
      since u r not the owner user ucan't directly select from other users table.

      method1:--grant prevelidges from the other user to the current user.

      mehod2:--use a dblink which connects to the second user.


      Hope this helps you.
      To access other user's objects, you must specify the schemaname.obje ctname. Or lese you can ask your DBA to create a synonym on that objetc and grant PUBLIC

      Comment

      • Saii
        Recognized Expert New Member
        • Apr 2007
        • 145

        #4
        Originally posted by Medhatithi
        To access other user's objects, you must specify the schemaname.obje ctname. Or lese you can ask your DBA to create a synonym on that objetc and grant PUBLIC
        As you say, you cannot access the table in a package but can access it in simple select, it is possible that the privilege on that table is granted through a role. To access it in packge, you need to have individual select privilege to the table.

        Comment

        • debasisdas
          Recognized Expert Expert
          • Dec 2006
          • 8119

          #5
          Yes that might be the possible reason.

          Comment

          Working...