Can select resource content in anonymous block, but not in stored procedure

I know the problem relates to the ACLs but am curious about the following behaviour:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
running on Windows XP sp2
Trying to access an existing resource '/home/test/test.dtd'
/home is owned by SYS
/home/test is owned by me
/home/test.test.dtd is owned by me
The following SQL and anonymous block retrieve the content of the resource:
select extract(p.res,'/*').getClobVal()
from resource_view p
where p.any_path = '/home/test/test.dtd'
declare
alldata clob;
begin
select extract(p.res,'/*').getClobVal()
into alldata
from resource_view p
where p.any_path = '/home/test/test.dtd'
dbms_output.put_line(substr(alldata, 1, 255));
end;
BUT when I encapsulate the anonymous block in a stored procedure, I am told that the folder '/home/test/' does not exist.
As said, the problem related to the ACL on the folders, what I cannot understand, and caused me considerable confusion, is why I was unable to get the content from a stored procedure when I was able to do so from an anonymous block.
regards
Richard

Use equals_path(res,'/home/test/test.dtd') = 1OK, OK, but how do you use wildcards (if you want to) since any_path like '/home/test%' works?
Who was the stored procedure owned by. Was it a stand-alone stored procedure or a
method on a package. If it was a method on a package is it AUTHID creator or AUTHID
definer.Everything apart from the '/home' folder is owned by the current user.
The PL/SQL was in a packaged procedure, a stand-alone stored procedure, and an anonymous block. It exhibited the same behaviour in each. All were defined with default AUTHID which is definers rights which is the same as the current user in this case.

Similar Messages

  • Cursor query works in anonymous block but not in procedure

    Hello,
    My cursor query works fine in anonymous blcok but fails in pl/sql block.
    Anonymous block:
    declare
    cursor c1 is
    select object_name
    from all_objects
    where owner='IRIS_DATA'
    and object_type='SEQUENCE';
    v_string varchar2(2000);
    begin
    for c2 in c1 loop
    v_string := 'DROP SEQUENCE IRIS_DATA.'||c2.object_name;
    execute immediate v_string;
    end loop;
    commit;
    exception
    when others then
    dbms_output.put_line('Exception :'||sqlerrm);
    end;
    works fine.
    but inside the procedure the it doesn't go inside the cursor loop
    procedure get_sequence is
    l_dp_handle NUMBER;
    v_job_state varchar2(4000);
    l_last_job_state VARCHAR2(30) := 'UNDEFINED';
    l_job_state VARCHAR2(30) := 'UNDEFINED';
    l_sts KU$_STATUS;
    v_logs ku$_LogEntry;
    v_row PLS_INTEGER;
    v_string1 varchar2(2000);
    cursor seq_obj is
    select object_name
    from all_objects
    where owner='IRIS_DATA'
    and object_type='SEQUENCE';
    begin
         log_status('get_sequence started.');
         --Cursor records to drop the sequences before importing.
         for seq_obj_rec in seq_obj loop
    log_status('get_sequence: Dropping sequence started.');
         v_string1 := 'DROP SEQUENCE IRIS_DATA.'||seq_obj_rec.object_name;
    execute immediate v_string1;
         end loop;
         log_status('get_sequence: Dropping sequence completed.');
    exception
    WHEN OTHERS THEN
    log_status('get_sequence: exception.');
    end get_sequence;
    it's not going into the seq_obj_rec cursor.
    I granted select on all_objects to the user.this user is also having the DBA role as well.
    Please advice.

    PROCEDURE Get_sequence
    IS
      l_dp_handle      NUMBER;
      v_job_state      VARCHAR2(4000);
      l_last_job_state VARCHAR2(30) := 'UNDEFINED';
      l_job_state      VARCHAR2(30) := 'UNDEFINED';
      l_sts            KU$_STATUS;
      v_logs           KU$_LOGENTRY;
      v_row            PLS_INTEGER;
      v_string1        VARCHAR2(2000);
      CURSOR seq_obj IS
        SELECT object_name
        FROM   all_objects
        WHERE  owner = 'IRIS_DATA'
               AND object_type = 'SEQUENCE';
    BEGIN
        Log_status('get_sequence started.');
        --Cursor records to drop the sequences before importing.
        FOR seq_obj_rec IN seq_obj LOOP
            Log_status('get_sequence: Dropping sequence started.');
            v_string1 := 'DROP SEQUENCE IRIS_DATA.'
                         ||seq_obj_rec.object_name;
            EXECUTE IMMEDIATE v_string1;
        END LOOP;
        Log_status('get_sequence: Dropping sequence completed.');
    EXCEPTION
      WHEN OTHERS THEN
                 Log_status('get_sequence: exception.');
    END get_sequence; How do I ask a question on the forums?
    SQL and PL/SQL FAQ
    scroll down to #9 & use tags in the future.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • I CAN SELECT A ITEM WITH TRACK PAD, But can not open the item

    Mac Book 15 inch
    OS X 10.10
    New to Mac
    Using track pad I can select an item by one click but can not open this item with 2 clicks.

    Go to System Preferences>Track pad and check the Secondary Click settings

  • Sharepoint foundation 2013: office docs can be opened in browser using IE but not in firefox or chrome?

    Hi
    Sharepoint foundation 2013:
    why when we open an excel or word  using chrome and firefox browser it wants to download the file.
    It can be opened in browser using IE but not in firefox or chrome?
    Any issues?
    Thanks

    Hello MGerio,
    Can you check what your Browser File Handling settings are of the web application (of the excel/word files)?
    http://social.technet.microsoft.com/wiki/contents/articles/8073.sharepoint-browser-file-handling-deep-dive.aspx
    - Dennis | Netherlands | Blog |
    Twitter

  • TA25361 I have a ton of documents and databases in AppleWorks v 6.0 that I can no longer open on my MacBook Pro.  Is there any way to recover this info?  Some documents can be opened and resaved with textedit, but not my database with all important addres

    I have a ton of documents and databases in AppleWorks v 6.0 that I can no longer open on my MacBook Pro.  Is there any way to recover this info?  Some documents can be opened and resaved with textedit, but not my database with all important addresses.

    I tried Peggy's List > Select All > Copy > Paste into an AW spreadsheet suggestion.
    In my case, pasting into the spreadsheet lost all text formatting (mostly text set to bold). The results of formulas were pasted, and checkboxes were pasted as "on" or "off". The DB did not contain any pop-up menus or radio buttons, but I expect they would transfer as a number showing the list position of the chosen item.
    Pasting the copied List view data into a Numbers table gave a result similar to that with AppleWorks. I selected B2 as the target cell (for top left cell of the pasted data) to avoid any effects of posting into a header row or column. Bold and regular text formatting looked the same as it had in AW's List view.
    Based on that, I'd slip the 'paste into an AppleWorks Spreadsheet step, and paste directly into a Numbers Table.
    Regards,
    Barry

  • Can video chat with Imac non-intel but not with Powerbooks

    Hi,
    I have a Linksys WRT54G firmware v. 1.0.6 connected to a Comcast Cable modem. My IMac Intel Duo (OS 10.4.6) is connected via ethernet cable to the router. I am set to DHCP on router and IMac. My Quicktime settings is at 1.5mb, I have tried with firewall off and on with the appropriate ports open. I have tried upnp on and off.
    I can connect to other Imacs (non-intel) but not to powerbook G4's. With the Powerbooks I can text chat, but sometimes they can see my text, but I can't see theirs. And every video chat is a fail to respond with the powerbook, but they can connect with others.
    Is there anything else I can do?
    Please help. Thanks.

    Hi cmbell,
    Do you know how to access your modem ?
    This should give you somewhere to turn off DHCP.
    Then you go to System Preferences > Network and select the connection method you are using.
    Then select the TCP/IP tab.
    In the drop down that says Using DHCP change it to Manually. (or Manual with DHCP if doing James' way)
    Type the IP you wish to use in the next entry field.
    Copy the subnet mask form the Using DHCP
    Copy any DNS servers listed.
    Copy the router IP address which will be the modem or router in question.
    Hit Apply.
    Done.
    9:23 PM Sunday; May 7, 2006
    Message was edited by: Ralph Johns (UK)

  • HT5858 In the control center I can change the mute or the rotation but not both.  How do I fix this.  In settings I can not uncheck both the mute and rotation lock.

    In the control center I can change the mute or the rotation but not both.  In the settings area therefore I can't uncheck the mute and rotation settings at the same time.

    Check your settings. The iPads have a small switch on the right edge. It can be used as a rotation lock to keep the screen from automatically reorienting itself as you move around, but you need to have the tablet’s settings configured properly. That same switch, right above the volume buttons, can also be set to function instead as a mute button to silence certain types of audio.
    If the switch is set to work as a mute button, you can change its purpose to “screen-rotation lock” by tapping the Settings icon on the home screen. On the Settings screen, tap General on the left side, and on the right side of the screen flick down to “Use Side Switch to.” Tap to select Lock Rotation or Mute to set the button’s function. Even if you set the side switch for your preferred use, you can still mute the Mini or lock the screen. Just double-click the Home button, and when the panel of apps appears along the bottom edge of the screen, flick the row from left to right with your finger. Tap the icon on the far left side of the row to either lock the iPad’s screen or mute the iPad’s alerts, notifications and sound effects. Music, podcasts and video are not muted unless you turn the volume all the way down.
     Cheers, Tom

  • I am using version iPhoto'11. Since I installed this version I experience some difficulties. After importation of pictures I can see the pictures under Library/Pictures but not under Library/Events. However I can see the event and the number of pictures.

    Hello,
    I am using version iPhoto'11. Since I installed this version I experience some difficulties. After importation of pictures I can see the pictures under Library/Pictures but not under Library/Events. However I can see the event with the event title, the number of pictures and the pictures itselve as small thumbnails. BUt ounce I want to open the event to see the pictures in full screen the event title annouces 0 pictures and no pictures are visble anymore to mee. I have checked if the pictures are marked as hidden and this is not the case. What's going wrong. All the other events are visible in a normal way.
    The albums with the same pictures into them are visible.
    Thanks for your help,
    Raf

    Make a temporary, duplicate copy of the library and try the two fixes below in order as needed:
    Fix #1
    1 - delete  the iPhoto preference file, com.apple.iPhoto.plist, that resides in your Home/Library/Preferences folder. 
    2 - delete iPhoto's cache files that are located in your Home/Library/Caches/com.apple.iPhoto folder. 
    3 - reboot, launch iPhoto and try again.
    NOTE: If you're moved your library from its default location in your Home/Pictures folder you will have to point iPhoto to its new location when you next open iPhoto by holding the the Option key.  You'll also have to reset the iPhoto's various preferences.
    Fix #2
    Launch iPhoto with the Command+Option keys depressed and follow the instructions to rebuild the library. Select options #1, #2 and #6.
    Click to view image full size
    OT

  • I can hear sound though my head phones but not though the speakers on my iPad how do I fix it

    I can hear sound though my head phones but not though the speakers on my iPad how do I fix it

    Or ... If you can hear music in the Music app without the headphones, you may have system sounds muted.
    If you lose sounds for keyboard clicks, games or other apps, email notifications and other notifications, system sounds may have been muted.
    System sounds can be muted and controlled two different ways. The screen lock rotation can be controlled in the same manner as well.
    Settings>General>Use Side Switch to: Mute System sounds. If this option is selected, the switch on the side of the iPad above the volume rocker will mute system sounds.
    If you choose Lock Screen Rotation, then the switch locks the screen. If the screen is locked, you will see a lock icon in the upper right corner next to the battery indicator gauge.
    If you have the side switch set to lock screen rotation then the system sound control is in the task bar. Double tap the home button and in the task bar at the bottom, swipe all the way to the right. The speaker icon is all the way to the left. Tap on it and system sounds will return.
    If you have the side switch set to mute system sounds, then the screen lock rotation can be accessed via the task bar in the same manner as described above.
    This support article from Apple explains how the side switch works.
    http://support.apple.com/kb/HT4085

  • How do I transfer photos/videos from my Iphone 5 to my Macbook Air. I can do so with my Iphone 4s but not with my Iphone 5

    How do I transfer photos/videos from my Iphone 5 to my Macbook Air. I can do so using my Iphone 4s but not with my Iphone 5

    See this User Hint: https://discussions.apple.com/docs/DOC-3141

  • Couldn't find the adequate forum.  I run win 8.1 and the adobe acrobat dc ap on my computer edoesn't acess the doc  cloud.  I can´t turn the mobile link on.  I can acess the clud from my browser, but not from the desktop ap.  I can acess from my mobile ap

    couldn't find the adequate forum.  I run win 8.1 and the adobe acrobat dc app on my computer doesn't access the doc  cloud.  I can´t turn the mobile link on.  I can access the cloud from my browser, but not from the desktop app.  I can access from my mobile app.

    Can you please post a screenshot of your Acrobat DC when launched, without opening a PDF?
    Thanks,
    -Amboo

  • I have a new iPad with wifi. When I send messages I can see my sons and my husbands but not my phone number.  We all have an iPad and all use the same apple ID as iPad the bill.  How can I remove their numbers and add mine?

    I have a new iPad with wifi. When I send messages I can see my sons and my husbands but not my phone number.  We all have an iPad and all use the same apple ID as iPad the bill.  How can I remove their numbers and add mine?

    Add another e-mail account to your messages, so people could reach you on that e-mail from messages. As soon as you are online (if you have wifi only iPad) you are able to send and receive messages. i.e. your son can send you a messages from his iPhone addressing it to your (that additional) e-mail address.

  • HT4864 How can I delete / close my iCloud email but not my iCloud account

    How can I delete / close my iCloud email but not my iCloud account

    On your iOS device, go to Settings>iCloud and turn Mail off.  On a Mac, go to System Preferences>iCloud and uncheck Mail.

  • I can see my ipad in my computer but not in itunes- how do i fix this?

    I can see my ipad in my computer but not in itunes- how do i fix this?

    Make sure you turn on the Menu and Sidebar if you are using the latest version of iTune.
    Ctrl+S to view Sidebar
    Ctrl+B to view Menu Bar

  • HT4539 Why I can download from iCloud on 1 iPod but not the other. It says downloaded but doesn't show up in music...

    I can download from iCloud to one iPod but not the other.  It says downloaded but doesn't show up in music...

    I'm not sure what you mean by the "music library" - are you looking in the Music app?  Or the iTunes app (which is not the one to be looking in)?

Maybe you are looking for