Why can I not see a table I own inside a procedure

I have a procedure owned by user X as follows:
create or replace  procedure ztm_get_debug_level is
  vc_pkg_name  system_parameter.name%TYPE := 'DEBUG_LEVEL_PKG_BASE_KEYS';
  vn_error     services.debug_log_level.debug_level_id%TYPE := 30;
  v_debugLevel   system_parameter.number_value%TYPE;
  function get_owner return varchar2 is
    cursor c1 is
    select owner from all_tables where table_name = 'SYSTEM_PARAMETER';
    v_Ret_Val VARCHAR2(30);
  BEGIN
    OPEN C1;
    FETCH C1 INTO v_Ret_Val;
    CLOSE C1;
    RETURN v_Ret_Val;
  END;
begin
  DBMS_OUTPUT.PUT_LINE('AAAA - ' || get_owner);
  select s.number_value
  into   v_debugLevel
  from   system_parameter  s
  where  s.name = vc_pkg_name;
  DBMS_OUTPUT.PUT_LINE('BBBB');
exception
  when no_data_found then
    NULL;
  when others then
   DBMS_OUTPUT.PUT_LINE('p_get_debug_level.WHEN OTHERS');
   raise;
end;
Table system_parameter is owned by user X.
When I execute I get:
TESTSSG.SUBSCRIPTION.87> exec ztm_get_debug_level
AAAA - X
p_get_debug_level.WHEN OTHERS
BEGIN ztm_get_debug_level; END;
ERROR at line 1:
ORA-00942: table or view does not exist
ORA-06512: at "SUBSCRIPTION.ZTM_GET_DEBUG_LEVEL", line 32
ORA-06512: at line 1
When I run the query outside the procedure as user X I get a row.
Any ideas?
FYI, there are no public sysnonyms.
DB version: 11.2.0.3.0
Thanks,
Thomas

Thanks Frank,
SYSTEM_PARAMETER is a table owned by X.  If I qualify the select statement by adding the owner it works, but of course I do not want to do that.  Here is the DDL for creating SYSTEM_PARAMETER:
create table SYSTEM_PARAMETER
  name         VARCHAR2(256) not null,
  date_value   DATE,
  number_value NUMBER,
  string_value VARCHAR2(512),
  comments     VARCHAR2(512)
alter table SYSTEM_PARAMETER add constraint PK_SYSTEM_PARAMETER primary key (NAME);
Again, if I rewrite the procedure to the following (only difference is the red X.), it works:
create or replace  procedure ztm_get_debug_level is
  vc_pkg_name  system_parameter.name%TYPE := 'DEBUG_LEVEL_PKG_BASE_KEYS';
  vn_error     services.debug_log_level.debug_level_id%TYPE := 30;
  v_debugLevel   system_parameter.number_value%TYPE;
  function get_owner return varchar2 is
    cursor c1 is
    select owner from all_tables where table_name = 'SYSTEM_PARAMETER';
    v_Ret_Val VARCHAR2(30);
  BEGIN
    OPEN C1;
    FETCH C1 INTO v_Ret_Val;
    CLOSE C1;
    RETURN v_Ret_Val;
  END;
begin
  DBMS_OUTPUT.PUT_LINE('AAAA - ' || get_owner);
  select s.number_value
  into   v_debugLevel
  from   X.system_parameter  s
  where  s.name = vc_pkg_name;
  DBMS_OUTPUT.PUT_LINE('BBBB');
exception
  when no_data_found then
    NULL;
  when others then
   DBMS_OUTPUT.PUT_LINE('p_get_debug_level.WHEN OTHERS');
   raise;
end;
This procedure exists in 4 other environments where there are no issues.  It can't be a privileges issue as the table is owned by user X and as you can see by the lookup (which was added for debug) against ALL_TABLES the owner is clearly X.  So, why can X not select from it's own table unless we include the owner?
Thanks,
Thomas

Similar Messages

  • Why can I not see any of my music purchases, I have not changed my ID or account details

    Why can I not see any of my music purchases, I have not changed my ID or account details?

    Hi,
    Please enable Speakers in Playback devices as follows:
    1. Right click speaker icon (right hand corner)
    2. Select Playback devices
    3. Right click Speakers
    4. Enable it and set as Default
    5. Click Apply/Ok
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • I imported 635 images into an iPhoto album so that I can share them via a photo-stream. However, iPhoto says there are only 600. When I try to add the missing images it says they are already there. Why can i not see these images in iPhoto?

    I imported 635 images into an iPhoto album so that I can share them via a photo-stream. However, iPhoto says there are only 600. When I try to add the missing images it says they are already there. Why can i not see these images in iPhoto?

    Generally I would not use Facebook for sharing any photos, it compresses the photos substantially, and when you have shadows and dark colours you get visible "bands" where there should be subtle gradients, ie at sunsets and sunrises.
    It sounds like you are using two methods to upload to Facebook:
    1. Sharing from within Aperture, which basically syncs Facebook with your Aperture album, so any changes made at either end gets synced, hence the deletions from Albums, although the original file should still be in your library, just removed rom the album. It is like a playlist in iTunes.
    2. Exporting pics and uploading to Facebook from the browser.
    I am not sure how method 1 gets compressed, but I know that uploading hi-res jpegs to Facebook using method 2 results in poor quality images.
    I wouldn't even bother comparing option 1 or 2, and they will both be poor images once you view them on Facebook, as opposed to viewing uploaded images on proper image sharing / hosting sites.
    Your problem is not with Aperture, it is using Facebook for showing your work.
    If you export pics form Aperture at high res jpegs or TIFFs your images will be fine.
    If you insist to use Facebook as your way to share your work, then your workflow should be this:
    1. Right click images you want to share.
    2. Select Export version.
    3. Export as 100% size and ensure the export settings are set at 100% quality.
    4. Upload this pic into Facebook.
    This will get you the best image size and resolution on Facebook.
    See how you go.

  • Why can I not see the SSID on my Mac but on my iPhone and iPad?

    Why can I not see the SSID on my MacBook Pro but I can see any easily connect on my iPhone and iPad?
    I can see all other networks close by though!
    Please help

    OS X Mail: Troubleshooting sending and receiving email messages

  • My computers are authorized and home sharing is turned on. Why can I not see the home sharing icon?

    my computers are authorized and home sharing is turned on...why can I not see the home sharing icon to troubleshoot and import libraries?

    Hello jfromlea,
    Thank you for using Apple Support Communities.
    You can use the following article to troubleshoot your Home Sharing issues:
    Troubleshooting Home Sharing
    Regards,
    Jeff D. 

  • Why can I not see the date messages are sent anymore

    Why can I not see the date messages have been sent anymore

    Drag your finger from right to left to reveal the time

  • Why can outlook not see my calendar

    why can outlook not see my calendar?
    When I click on icloud in my outlook calendar, I get this error:
    The set of folders cannot be opened. The information store could not be opened.
    it all used to work perfectly!

    You need to republish your website...
    http://www.iwebformusicians.com/iWeb/Publish-Website.html
    ... to a new host...
    http://www.iwebformusicians.com/iWeb/Website-Hosting.html
    If you don't have a domain name, your host should supply one for free. If you do have one, you need to contact yout domain registrar to forward it to the new location of your website files.

  • Why can I not see an audio book purchased from another computer on my cloud

    why can I not see an audio book purchased from another computer on my cloud

    Where did you download it from? What format is it in?

  • Why can I not see

    Recording audio in Logic Pro: Why do I not see the audio waves when recording normally? Only with punch-in recording I can see them..

    Recording audio in Logic Pro: Why do I not see the audio waves when recording normally? Only with punch-in recording I can see them..

  • HT4623 Why can I not see the new 7.1 features on my iPhone 4s

    Why can't I see the new 7.1 features installed on my iPhone 4s

    Hello Dfviens,
    iOS 7.1 has had some bug fixes and minor UI changes. IE: Caller UI, Power off UI.
    ^Connor

  • Why can I not see shared applications on iTunes on a Mac but can on Itunes under Windows

    Hello
    1. I have a Mac Laptop, a Windows 7 laptop and an IPAD Air. I have an application on the IPad that shares files.
    2. On both the Windows and Mac machines, I have the latest versions of ITunes installed.
    3. With Image and IPhoto, I can browse the Documents directory of the shared application on the IPAD.
    4. On the Windows Machine, on ITunes, under the Apps section, at the bottom of the screen, I can see the shared application and the shared Documents directory.
    5. On my Mac Machine, on Itunes, under the Apps section, at the bottom of the screen, I can NOT see the same shared application on the IPAD that I see on the Windows machine.
    6. In the upper right corner of Itunes on the MAC it does show "1 App" but I see no way to click on the app under ITunes and to browse the shared directory on the IPad
    Any thoughts on what I have to do to make the Shared App show up on the Mac that shows up on the Windows machine in ITunes?

    Did you put your audiobooks on your computer?
    They will only be where you put them.  You need to copy them from your old computer or your backup copy of your old computer.

  • Why can                                             i not see voicemail on phone?

    can not see voicemail on screen/

    When I miss a call it doesn't show that I have a voicemail and when I try and hear voicemails it is empty. Also it is not my voice of the message.

  • TS4002 why can I not see deleted mail in trash bin? I have clicked on "sent deleted mail to trash" in preferences!

    Why can i no longer see deleted mail in my trash bin?  I have clicked on "sent to trash" in the preferences!

    go to Help Menu -> select "Restart with Add-ons Disabled"
    Check if it works without Add-ons.
    Firefox will close then it will open up with just basic Firefox. You can enable the Add-ons later. Check and tell if its working.

  • Why can I not see and read individual files in icloud?

    According to the Genius at my local Apple store I have something in the software or files I backed up that us causing a problem with my iphone5, and the solution is to do a 'restore as new phone' after having saved all my data somewhere else (e.g. store all my photos and videos to flickr, email my voice corder files to myself by email) - in other words a major hassle.
    I don't understand why myself or an Apple technician can't just go into my icloud account, do a surgical strike to identify and destroy wherever the problem is and go from there.
    To restore piecemeal is cumbersome and time-consuming. And then I still won't know what caused the problem in order to avoid the problem reoccurring (such as avoiding certain third-party apps or whatever is the problem).
    Makes me think that maybe Dropbox or Google drive might be better choices from some purposes. I got icloud as a cyber filing cabinet, not just a backup if phone or to share across devices.

    You can see the individual data in your iCloud account.  You can see any of it within the apps on your phone that are syncing with iCloud (contacts, calendars, notes, reminders, etc.).  But how would you ever be able to tell which one is corrupt just by looking?  And that doesn't account for the thousands of files that make up the iOS, of other non-iCloud files on your phone.

  • Why can I not see other libraries in Home Sharing?

    I have tried EVERYTHING! I cannot figure out why my mac and PC will not communicate. I have authorized both computers with the same Apple ID and Home Sharing log in is all the same for both computers. I have turned off firewalls on both computers. They are signed into the same network. BUT there is still nothing under the Home Sharing tab of the menu bar. Can anyone please help! Thanks

    check out these links:
    Troubleshooting security software issues
    Troubleshooting Home Sharing
    and, last but not least, see this discussion concerning bonjour being the culprit.

Maybe you are looking for