Can wpg_docload work with the embedded plsql gateway?

Hi,
Looking at all the sample code with wpg_docload.download_file. Put the following in a plsql region, but it does not work. Is it due to my running with the embedded plsql gateway, rather than http server and mod_plsql?
Here's the code. The file exists and is a small 213-byte file.
declare lob_loc bfile;
v_length integer;
fname varchar2(100) := 'x.txt';
begin
lob_loc := bfilename('CELFILES_9906', fname);
v_length := dbms_lob.getlength(lob_loc);
owa_util.mime_header('text/plain', false);
htp.p('Content-length: ' || v_length);
htp.p('Content-Disposition: attachment; filename="' || fname || '"');
-- close the headers
owa_util.http_header_close;
-- download the BLOB
wpg_docload.download_file( Lob_loc );
end;
It returns:
"HTTP/1.1 500 Internal Server Error Server: Oracle XML DB/Oracle Database Content-Type: text/html; charset=UTF-8 X-DB-Content-length: 213 Transfer-Encoding: chunked Transfer-Encoding: chunked"
The filesize is correct and if I comment out the call to wpg_docload.download_file I see:
"Content-type: text/plain; charset=UTF-8 Content-length: 213 Content-Disposition: attachment; filename="x.txt""
Thanks.
Susan

Hi,
Tried simply doing the grant, but it did not work. Aside from having a bit of trouble with the loadblobfromfile (had to enumerate all 5 parameters) and also having to specifically do a dbms_lob.open, it worked!
Here's the final code that worked:
declare
lob_loc bfile;
v_length integer;
fname varchar2(100) := 'x.txt';
l_blob blob;
des_offset number := 1;
src_offset number := 1;
begin
lob_loc := bfilename('CELFILES_9906', fname);
v_length := dbms_lob.getlength(lob_loc);
DBMS_LOB.createtemporary(l_blob, FALSE);
dbms_lob.open(lob_loc, dbms_lob.lob_readonly);
DBMS_LOB.LOADBLOBFROMFILE(
dest_lob=>l_blob,
src_bfile=>lob_loc,
amount=>v_length,
dest_offset=>des_offset,
src_offset=>src_offset);
owa_util.mime_header('text/plain', false);
htp.p('Content-length: ' || v_length);
htp.p('Content-Disposition: attachment; filename="' || fname || '"');
-- close the headers
owa_util.http_header_close;
-- download the BLOB
wpg_docload.download_file( l_blob );
DBMS_LOB.freetemporary(l_blob);
EXCEPTION WHEN OTHERS THEN
DBMS_LOB.freetemporary(l_blob);
RAISE;
end;
Thanks Udo.
Susan

Similar Messages

  • Can't work with the Query after I save a 3.5 Query in 7.0 Query Designer

    Hello,
    my Problem is, I open a 3.5 Query in a 7.0 Query Designer. Then I save as another name. When i Open the Query
    i can't change things... WHY ? A Standart Transport is OK in RSA1, Transport, BexTransport. all ok..
    can't work with the Query after I save a 3.5 Query in 7.0 Query Designer
    Best Regadrs

    Hi,
    I cant click on it. It is grey..
    I open the 3.x Query in a 7.0 Query Designer and save as another name.. Then I try to open it with the 7.0 tool. The Query is displayed. But I cant change something...
    thnx

  • Mistakenly opened all the folders in my library of music and the Finder stopped working. Now every time I restart the mac, all folders are reopened and can not work with the finder and tried killall-KILL Finder and nothing they reappear

    mistakenly opened all the folders in my library of music and the Finder stopped working.
    Now every time I restart the mac, all folders are reopened and can not work with the finder and tried killall-KILL Finder and nothing will reappear

    mistakenly opened all the folders in my library of music and the Finder stopped working.
    Now every time I restart the mac, all folders are reopened and can not work with the finder and tried killall-KILL Finder and nothing will reappear

  • I have LabView but I do not have the Calibration and Configuration Palette,and I could not download it, how can I download it or if i cannot,can I work with the NI-DAQ Calibration_1200?

    I have read in a tutorial for the board 1200 that I can calibrate it with the Calibration and Configuration Palette in LabVIEW, but I do not have them and I could not download it to access its libraries, so I can only download the NI-DAQ software,What's my best choice and if it is to download the palette with its libraries, how can download it with them?I'd appreciate your answers

    If you wish to use your 1200 device in LabVIEW, you must download and install NI-DAQ. When you install NI-DAQ, it will ask you if you would like to install support for LabVIEW. By installing this support, you will then have access to the DAQ pallette in LabVIEW. The DAQ pallette requires that you have NI-DAQ installed.
    For more information on installing and using your device, you can refer to the DAQ Quick Start Guide. You can download it from:
    http://digital.ni.com/manuals.nsf/14807683e3b2dd8f8625677b006643f0/0eca53fe80911b1f862568560068295d
    Regards,
    Erin

  • HT201358 Can ARD3 work with the Active Directory setup on a Windows machine and without the need of Open Directory

    We need the 'Golden Triangle' setup to work with ARD3 running on a Mac server with client Mac details retrieved from a Windows Active Directory. In this system, the ARD3 will be used to install packages from a Mac OS X server, where the client Mac list is gathered directly from a Windows Active Directory, which is already in place.
    So, please guide me whether Apple Remote Desktop 3 is capable of getting client machine details from an Active Directory without the need of re-creating the client Mac list in the Mac server running ARD3.
    If ARD3 can not be used in this case, do you recommend any other tools that can resolve our issue.
    Thank you in advance.
    Sudheesh.

    ARD cannot directly obtain client information from Active Directory, no. It may be possible to create a script that would get such information and be able to put it into ARD, but I wouldn't begin to know how to write such a script. You may also be able to bind your OS X Server to ARD and create groups there. This article is obsolete for 10.6 or later but may provide some clues as to how to proceed:
    http://support.apple.com/kb/TA24276
    There are a number of third-party systems that can manage Macs that may be able to draw information from AD, such as Casper, LANDesk, and others. Which if any would meet your needs depends on many factors including how many devices you need to manage, whether you're looking for a cross-platform tool, your budget, etc. This is a difficult issue to address in a forum like this since there are so many variables to be considered.
    Regards.

  • The page won,t open I get the settings were changed by another application message. It keeps appearing to I can't work with the diagnosics

    The page won't open when I click on the firefox icon I go to system preferences for dianostics and "the settings have been changed by another application" I can't close that message to keep on working.

    Are you referring to a wireless router, such as an Airport Express? If so, and you bought a different router, you will need to set up the new router according to their instructions. With my Netgear, I had to go to their online website (they should have the URL listed in the instructions) and set it up there because the software that comes with routers is not compatible with Macs.
    If you're talking about something else, then please let me know - I've just never heard of an Airport modem.

  • Leaopard 10.5.1 - can't work with the os x install cd - please help

    Hey guys...
    I have a Power Mac G5 Dual. I want to re-install my settings, specific files and so on... I don't want to delete everything and re-install. I want to keep my current user, with it's programs, folders and so on.. I know that you're to use the os x cd, and press special under the installation and choose something where you still can keep your user..... However I can't do that: every time I restart my Power Mac and it starts of from the Cd, I choose a language but when i press next, it says: cannot opdate to v10.5 on your computer..
    Why does it say that? I just want to keep my user, but not delete and re-installl everything!!
    Help please : )

    FreakOutBoy wrote:
    Hey guys...
    I have a Power Mac G5 Dual. I want to re-install my settings, specific files and so on... I don't want to delete everything and re-install. I want to keep my current user, with it's programs, folders and so on.. I know that you're to use the os x cd, and press special under the installation and choose something where you still can keep your user..... However I can't do that: every time I restart my Power Mac and it starts of from the Cd, I choose a language but when i press next, it says: cannot opdate to v10.5 on your computer..
    Why does it say that? I just want to keep my user, but not delete and re-installl everything!!
    Help please : )
    Welcome to the Apple forums:
    If you are trying to do a standard update to Leopard and you are already running Leopard, you have to choose the archive and install. The standard upgrade is only from Tiger or lower to Leopard.
    After the language screen, at the lower left, I believe, is an "Options" button. Click it and select archive and install.
    This should keep all your present settings, but I would caution you that you shuold NOT do anything unless you have a full backup of your present system.
    You did not specify why you want to reinstall Leopard. Maybe you do not need to do a complete reinstall if you would post your problems.
    Again, don't do anything unless you have a current backup either with TM or CarbonCopy.

  • I failed to register on photoshop in time. How can I work with the  photos I have there?

    I already have photos on my computer in Photoshop but I failed to register within the time limit, so now I cannot do anythiing with my photos. How can I get to use my photos that I already have on photoshop? I am just now  signing up for an account on Photoshop.

    Bryant,
    Your photos aren't stored in Photoshop. They are stored on the hard drive, they only open in Photoshop.
    Check your hard disk for the photos you're searching for.
    -ST

  • How can I work with the video feature on iPhone 3G after the new download?

    I have an 3G iPhone and have downloaded the software of iPhone 4. I still cannot make any videos. How can I do that? There is not the buttom to switch from pictures to video. Please, can anyone help me? Tks in advance.

    The upgrade doesn't implement the use of video. Why would you think it does?!

  • I have an iPod G2 with a firewire 400 lead. how can I attach it to my new 13 inch Mac book Pro, is there a 400 to 800 firewire converter. USB lead wont work with the Macbook Pro. iPod used as an external drive to archive memory cards on the go.

    My G2 iPod that I use as an external drive to archive memory cards on the go cannot link with my new 13" Macbook Pro cause it uses a firewire 400 lead. It will not work with a USB lead. Is there a firewire 800 ipod lead or converter available? Can any one shed some light on this please?

    As far as I know, if a harddrive works with a Macpro, it should work with the Macbook: if your Macbook is low on power, plug in the AC adapter
    If your Macbook has a firewire port, then it should be fine. BUt i would do somemore research first.

  • Sharepoint list dataheet view error "Cannot connect to the server at this time. You can continue working with this list, but some data may not be available"

    I have a List which is having around 14000 items in it.while opening that list in datasheet view it is giving error .
    Below is a summary of the issue:
    After selecting datasheet view beow error occurs:
        "Cannot connect to the server at this time.  You can continue working with this list, but some data may not be available."
        "Unable to retrieve all data."
        The item counts displays say 100 out of 14000 items.
    Exporting List to excel is giving only 2000 records out of 14000 records.
    Other Observations   -  
    This is happening to only one list on the site .There are other lists in the site whose no. of records is equal to 8000 to 9000.They are working absolutely fine without any error.
    Also, If I am saving this list as a template and creating another list with it ,then it is working absolutely fine with 14000 records,so the issue does not seem to be related with no. of records as the template list is working fine.
    I have checked the Alternate access mapping setting ,its fine.
    It should not be related to lookup,datefield or any other column as the list created from it template is working fine with all these columns.
    I checked below links also ,but doesn't seem to work in my case.
    http://social.technet.microsoft.com/forums/en-US/sharepointadminprevious/thread/974b9168-f548-409b-a7f9-a79b9fdd4c50/
    http://social.technet.microsoft.com/Forums/en-US/smallbusinessserver/thread/87077dd8-a329-48e8-b42d-d0a8bf87b082
    http://social.msdn.microsoft.com/Forums/en-US/sharepointgeneral/thread/dc757598-f670-4229-9f8a-07656346b9b0

    I have spent two days to resolve this issue. Microsoft has released two KBs with reference to this issue...but are not appearing in search results at the top.
    I am sharing my finding.
    1. First install the
    KB2552989 (Hopefully you might have already installed it. The KB detetcts it and informs the user.)
    2. Then update registry by adding new key for data fetch timeout as mentioned inKB2553007
    These two steps resolved the issue in our environment. Hope it might help others as well.
    Pradip T. ------------- MCTS(SharePoint 2010/Web)|MCPD(Web Development) https://www.mcpvirtualbusinesscard.com/VBCServer/paddytakate/profile

  • The apple store is so unhelpful. I have an iMac computer operating on Mac OSX 10.5.8. I want to upgrade to the latest Mountain Lion operating system so I can work with the iCloud on my computer and download my email. I can't seem to purchase this on-line

    The apple store is so unhelpful. I have an iMac computer operating on Mac OSX 10.5.8. I want to upgrade to the latest Mountain Lion operating system so I can work with the iCloud on my computer and download my emails. I can't seem to purchase this on-line as it keeps telling me to go to the app store. I haven't got the app store on my computer as I am told I need iCloud for which I need the new operating system, which I can't download or purchase as I am sent back to an instruction telling mee to go to the app store icon.
    How difficult can it be to simply purchase the software on-line have it shipped to you so you can install it, in the event it cannot be downloaded as it appears it can't be based on my curent operating systems being Mac OSX 10.5.8.

    Requirements for OS X 10.6 'Snow Leopard'
    http://support.apple.com/kb/SP575
    Whilst Apple have withdrawn Snow Leopard from download, you can still get it from Apple by calling 1-800-MY-APPLE (if you are in the USA) and they will supply the SL DVD for $30.  You can also purchase the code to use to download Lion from the same number.
    Requirements for Mountain Lion:
    http://www.apple.com/osx/specs/

  • Hi all, i can't sync over wifi between my iPhone 4 and Windows 7 64 bit, wifi sync works with the same phone and my Windows 8 machine, tried solutions from other threads with no luck, just thought i'd see if anyone else had any ideas, thanks.

    Hi all, i can't sync over wifi between my iPhone 4 and Windows 7 64 bit, wifi sync works with the same phone and my Windows 8 machine so the problem seems confined to Windows 7. I've tried solutions from other threads -
    Making sure everything is allowed through firewall
    Rebooting phone/laptop/router
    Disabling ipv6
    Disabling all networks except the one curently on
    Re-installing iTunes
    Restoring iPhone
    No luck with any of those unfortunately so i just thought i'd see if anyone else is still without wifi sync after trying those as well and if you ever found a fix, thanks.

    I just wanted to leave a note that it's working now. I'm not sure if it was the latest iTunes update that got it working or that i decided to start a new library instead of using the one i had backed up on Windows 8 (it didn't occur to me to check using the old library when i re-installed iTunes). But if anyone is having this problem, it might be worth trying again with a new installation of iTunes to see if the latest update works for you, and if not, try using a fresh library instead of a backup (by fresh library i mean discard your old library completely and start a new library, not just restore as new iPhone, a whole new library).

  • Purchased Lion, installed it - once I log in - i get the curtain and message to hold the power button till it shuts down.  Worked with the disk repair utility - fixed permissions - still can't get past the "black curtain of death"  any suggestions?

    purchased Lion, installed it - once I log in - i get the curtain and message to hold the power button till it shuts down.  Worked with the disk repair utility - fixed permissions  to hold the power button till it shuts down.  Worked with the disk repair utility - fixed permissions - still can't get past the "black curtain of death"  any suggestions?
    My machine was patched to date 10.x.x.  I was lucky to get an internet connection and I selected the option to re-download Lion... its curruently being downloaded.  What if that doesn't work?
    Any thougths would be appreciated.
    Joe

    And you have a workstation? not a notebook. 
    Usually a driver or hardware, nothing that Disk utility will fix.
    You know of course what a Prohititory Sign is?
    prohibitory sign, kernel panic
    Forum devoted to Lion:
    Mac OS X v10.7 Lion Communities
    Tips and FAQs
    FAQ kernelpanic
    Resolving Kernel Panics
    Avoiding eliminating Kernel panics
    Lion App Compatibility Table - RoaringApps
    RoaringApps Mac OS X Lion Application Compatibility
    did you make sure your apps, drivers, and hardware support Lion?

  • My hard drive crashed on my Imac 24" 2009, i put in a new hard drive 2TB and a SSD drive 240 GB and removed the opticdrive. What external DVD can I get to work with the IMac? The Apple super drive is not compatible.

    My hard drive crashed on my Imac 24" 2009,  I installed a new hard drive 2TB and a SSD drive 240 GB and removed the optical drive.
    What external DVD can I get to work with the IMac?                              The Apple super drive is not compatible.

    Virtually any DVD burner that can connect to your Mac will work. They start at $40 on Amazon.

Maybe you are looking for

  • Wrong Vendor Invoice Posting Due To Wrong Excise Tax Code

    Hi: We have created a Purchase Order as per below: Qty     10 Price     100 Value     1000 Excsie 10%     0 Cess     0 SECess     0 Value+Excise     1000 VAT 5%     50 ValueExciseVAT     1050 (Please note that the PO was to be created in the followin

  • My Imac won't read an external hard disk. No icon in the finder. It's visible in the disk uitility. NTSF format

    Hi! Every time I connect my hard disk, I get this message: The hard disk is in NTFS format. So far I've connected  3 different hard disks, and I always get the same message. I also have a mac laptop and I can see all of them in the finder and read an

  • Sql developer connectivity problem

    Hi, I'm finding it difficult to connect my downloaded sql devloper to the oracle. I am doubting if my login details were correct, or there re some other configurations that needs to be done. Please can you tell me how I can get to retrieve my usernam

  • Bridge CS4 not rendering images correctly

    i have macbook 10.4.11 with 60 GB free, and 2GB of RAM and when i hit the space bar in bridge to view my photos at full screen the photos do not sharpen. they used to but now they don't, they just remain blurry. i have tried "purge cache" and checkin

  • Macbook pro speakers stopped working, earbuds fine

    My macbook pro speakers stopped working, but the earbuds work fine.  Tried restart and preferences.  Volume icon is grayed out, except when earbuds are plugged in.  What am I missing?