Download clob contents from function instead of a blob column in a table

I found some examples how to create a download link for data stored in a blob column. However my data is not stored in a blob column but is created in a function returning a clob. Obviously this function can be used to fill a blob column that can then be downloaded but maybe there is a more direct route.

Hello Rene,
I adapted one of my snippets for download-links for your case. The procedure is pretty much the same like the one concerning an existing blob. To provide the download, you need to convert your clob into a blob, which can be done easily by using the corresponding function provided by the [url http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_lob.htm]DBMS_LOB-API.
The result might look like the following (untested) code snippet:
CREATE OR REPLACE procedure download_from_function (p_func_argument IN VARCHAR2, p_filename IN VARCHAR2)
AS
  l_http_response  UTL_HTTP.resp;
  l_blob           BLOB;
  l_raw            RAW(32767);
  l_length         INTEGER;
  l_dest_offset    INTEGER := 1;
  l_src_offset     INTEGER := 1;
  l_lang_context   INTGER := DBMS_LOB.DEFAULT_LANG_CTX;
  l_warning        INTEGER;
BEGIN
  -- Initialize the BLOB.
  DBMS_LOB.createtemporary(l_blob, FALSE);
  -- replace the function call for src_clob
  DBMS_LOB.convertToBlob( dest_lob     => l_blob,
                          src_clob     => your_clob_function(p_func_argument),
                          amount       => DBMS_LOB.LOBMAXSIZE,
                          dest_offset  => l_dest_offset,
                          src_offset   => l_src_offset,
                          blob_csid    => DBMS_LOB.DEFAULT_CSID,
                          lang_context => l_lang_context,
                          warning      => l_warning);
  l_length := DBMS_LOB.getlength(l_blob);
  -- create response header
  OWA_UTIL.mime_header('text/plain', false);
  -- add furhter header attributes
  htp.p('Content-length: ' || l_length);
  htp.p('Content-Disposition: attachment; filename="' || p_filename || '"');
  -- close the headers
  OWA_UTIL.http_header_close;
  -- download the BLOB
  WPG_DOCLOAD.download_file( l_blob );
  -- release BLOB from memory
  DBMS_LOB.freetemporary(l_blob);
EXCEPTION
  WHEN OTHERS THEN
    DBMS_LOB.freetemporary(l_blob);
    RAISE;
END download_from_function;
-- Page process before header on blank page
BEGIN
  download_from_function (p_func_argument => 'your_argument_for_your_clob_returning_function',
                          p_filename => 'filename_for_download.txt');
END;You should change function name and arguments to fit your clob-function's signature. You may also want to add a characterset conversion if needed. See the [url http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_lob.htm]API-doc for details.
-Udo

Similar Messages

  • HT3702 can i download free content from itunes and app store without any billing information?

    I am a iPhone 3gs user firmware version 3.1.3 . the question is can i download free content from itunes and the app store without billing info ? please help !

    If you only want the free apps, take a look here:
    http://support.apple.com/kb/HT2534
    Read the steps carefully as the order in which you follow them is  critical. Note that you can do this only when creating a new Apple ID. You cannot use an existing ID. 
    You will of course not be able to get anything other than the free apps without entering in some sort of payment method (credit card, prepaid iTunes card, gift certificate, etc.)
    Regards.
    Forum Tip: Since you're new here, you've probably not discovered the Search feature available on every Communities page, but next time, it might save you time (and everyone else from having to answer the same question multiple times) if you search a couple of ways for a topic, both in the relevant forums and in the Apple Knowledge Base, before you post a question.

  • I am getting a content protected error that won't allow my downloaded HD content from iTunes to play on my macbook air!  help, please

    I am getting a content protected error that won't allow my downloaded HD content from iTunes to play on my macbook air!  help, please

    This may seem obvious, but presumably you have authorized the MacBook Air in iTunes?

  • In download to excel from bsp hw to increase excel column width to wrap txt

    in download to excel from bsp how to increase excel column width to wrap text
    in each column.
    My client does not want to manually click each cell aftet downloading to excel to see full text in each column

    Hi,
    You can achieve this by formatting your output using HTML table tag.
    Try the following code.
      DATA: lv_output  TYPE string.
      concatenate
      '<table border="1">'
      '<tr style="font-weight: bold; text-align:center; "><td>Name</td><td width="150">Description</td></tr>' cl_abap_char_utilities=>cr_lf
      '<tr><td>First Name</td><td>Some Description goes here..... ....... ...... </td></tr>' cl_abap_char_utilities=>cr_lf
      '<tr><td>2nd Name</td><td>XYZ.......</td></tr>' cl_abap_char_utilities=>cr_lf
      '</table>'
      into lv_output.
      response->set_cdata( data = lv_output ).
    Regards
    Geogy
    PS. Reward the useful answers.

  • HT3951 how do i re-download deleted content from itunes?

    I was using itunes from my PC and accidently deleted some content that I wanted to keep. I was trying to download to PC to make room on my Ipad but didn't see the Download all button at the bottom, till after. Have tried to go into my itunes account to look for deleted content but it shows nothing. Hopefully I don't have to pay or purchase again but please let me know what I can do. 

    Downloading past purchases from the App Store ... - Apple - Support

  • Insert data from XML in a BLOB column to a table

    I have a situation where my source table has a blob column and an XML file is loaded into it.
    Whenever an insert into the table happens I need to read the XML and insert the values from XML to a target table .
    I have done it with oracle inbuilt parser and tokens but this will do a call to the database when already the data is available on the extract file.That would mean a lower performance .
    Can someone help me maybe with some userexit or something
    Thanks in advance

    Please check if you can see the 'DBMS_XMLSAVE' object in all_objects.

  • Function key and moving the columns in a table

    Hi all,
    Can anyone help me how to make use of function key UI element in nwds 7.1 ehp1 version..
    and also how to move the columns of the tables at run time...
    thanks,
    viswa

    No,
    i am not working on mobiledevices...
    i am recently installed this nwds 7.1 ehp1 version  and learning the new things in that...
    for that purpose i am searching for the pdf's or examles here...
    can anyone pls send me the tutorials or samples to work on it
    thanks,
    viswa

  • Function module to find the columns in Internal table

    Hi Group,
    Is there any function module which displays the columns of the internal table. I guess there is one cos when we debug any program and select the "Tables" button while debugging and enter an internal table and then do a "Find" the pop up which comes up shows the internal table columns. As this functionality is in the debugger which I cannot debug hence was wondering if some one has come across any such function module. Thanks in advance.
    Regards,
    Ankur Bhandari
    [email protected]

    Hi again,
    1. In the above FM
       Pass Program as SY-REPID (U cann pass other prg name also)
    in FieldName Pass the name of the internal table
       eg. 'ITAB'
    2. This FM will give u the details of the
       internal table.
       The u can display the COMPONENTS table
       using ALV or anyother method u like.
    Regards,
    Amit M.

  • Can i download my content from the icloud, after i moved to another country?

    i created my itunes account in germany, and then i moved it to the USA. i purchased all kinds of content, and it works just fine.
    now i want to move back to germany. i know, i can keep my content on my computer, but can i redownload it from the icloud in germany, or do i have to purchase everything again to do so?

    Hi maliappleid,
    Sounds like you need to go into Settings>iCloud and sign on your Apple/iCloud ID. You cannot access iCloud via the browser on an iOS device. You need to have iCloud signed on on your device. Once you get iCloud signed on, turn on the items you want sync'd to your device from iCloud. Once you are connected to Wifi, these items will sync to your device.
    Cheers,
    GB

  • TS3274 iPad won't download purchased content from iTunes

    Greetings
    iPad newbie here. I've been trying to download Breaking Bad season 4 for a couple of weeks and I keep getting an error message
    Any thoughts would be appreciated
    Thanks in advance

    Choose Authorize Computer from the Store menu in iTunes and enter your iTunes Store account information. Changing the hardware configuration may cause iTunes to think it's on a different computer.
    (33530)

  • Uploading Contents of af:inputFile to a BLOB Column (Steve's exampl)

    Maybe every one who have seen this example of Steve can give me a suggestion...
    i want to add this upload field in an adf form, in wich i will have not only this upload field but even some other fields wich will save some data in the same table in database. I tried to add that field button inside a form, and removed the upload button, added the save and create button from Data control Palete. When i click on the save button there are saved 2 rows in the database.
    1. wich saves only the upload files
    2. the other wich saves the upload fileds+ the other fields i added..
    i am sure i have done it wrong:) Want a suggestion what should i change on the Steve's code
    THanks in advance :)

    I just tried - it downloads fine...

  • Can't download content from Distribution Server on Android

    I've compiled an app using the Android option from the Adobe Viewer Builder.
    Everyhting works fine even installing it on and Android tablet but at the moment of downloading the content from the Distribution Server, the progress bar doesn't move and it shows the legend "Waiting" and starys there forever..
    Any ideas what could be hapenning?

    Hello John:
    Thanks for your reply.. I did Publish the folio and I CAN download it really fast on the Distribution Server and watch it fine on the iPad but when I try to download it the same folio on the Staging Server, no luck yet, even both have the same size (and HTMLResourcez.sip file either)
    Any further ideas??

  • Server tries to download updates from MS instead of configured WSUS server

    Hey all,
    I got some strange behaviour of a server that I try to update with our WSUS server. Both the client and the WSUS server are Win2k12, not R2. A policy is applied on all servers in which the WSUS server is set. Actually, the update procedure and the policy
    works on all servers but this one.
    I am able to find and select updates for the target server on my WSUS server and the server is able to find the server. When I try "Install now" on the target server, nothing happens. According to the log the server is communicating with the WSUS
    server, but is not downloading the updates from it, instead it tries to download them from MS itself what is not possible. I inserted my proxy user and then it worked so I nailed it down.
    How can I reset all the configuration or where is the registry key that leads to the download source?
    Thanks in advance and kind regards,
    Azreth

    The registry keys for the update source are controlled by the group policy, so configuring the policy and making sure it is applying correctly will automatically configure the appropriate registry keys.  However, the keys specific to windows updates
    are located here:
    HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate
    WUServer
    Reg_SZ
    HTTP(S) URL of the WSUS server that is used by Automatic Updates and API callers (by default). This policy is paired with WUStatusServer, and both keys must be set to the same value to be
    valid.
    WUStatusServer
    Reg_SZ
    The HTTP(S) URL of the server to which reporting information is sent for client computers that use the WSUS server that is configured by the WUServer key. This policy is paired with WUServer,
    and both keys must be set to the same value to be valid.
    The full list of related keys can be found here: http://technet.microsoft.com/en-us/library/dd939844(v=ws.10).aspx

  • SCCM/WSUS 2007 01-2015 Bulletin Patching issue. Some clients patch just fine, some will not download the content.

    Bit new to the admin side, so please excuse some ignorance.
    We have approx 6000 end points.  We setup this months patches and a couple out of cycle ones we noticed.  We are getting a TON of clients that will not patch.  They are getting the defintions but when we attempt to run the advertised
    patches they fail approx 10 seconds later.  However, some servers on the same boundry will patch just fine.  We get the error message in the logs that when the client was told to download the content from the DP, it spits out error that content does
    not exist.  The DPs we believe are having the issues are MPs as well sitting in DMZ.  We have 2 sites configured basically the same, both DP/MPs in DMZ are the ones having the issues.  We have confirmed clients are able to connect anon to the
    DP/MP.  But again, some clients are patching just fine.
    UpdatesDeployment.log has the following warning listed 7 times.
    Not refreshing update presence state as error CI Info status received
    But yet does see that it needs 7 patches.
    EnumerateUpdates for action (UpdateActionInstall) - Total visible updates = 7
    No other logs show any errors on the clients.  I have confirmed the content is avalible on the DP/MP it is reporting too. Obviously though since other clients sitting right next to them work still.
    Any ideas?  Trying to avoid working all weekend.  Thank you!

    We checked every single log on every MP, DP, SS and many clients.  For unknown reasons, deleteing and rebuilding the Jan update list did the trick.

  • Download ipod content to a new itunes library

    Tired of sharing iTunes with my kids.  How do I download the content from my iPod Classic to a new iTunes library?

    See this thread from another forum member Zevoneer on different ways to copy content from your iPod to your PC.
    https://discussions.apple.com/thread/2452022?start=0&tstart=0
    B-rock

Maybe you are looking for

  • Query disable status in bex query designer

    hi all, when i opened query in query designer for PA_PA cube it is in disabled mode.iam unabled to restrict or do any changes.and giving error like "the dependent objects are in different transport orders."i installed this particular queries in BI co

  • How to get the closing event (not closed) of Dialog control

    Hi All, I have one requirement, that I have to close the Dialog box in an animated way like on clicking of the Dialog close button the popup has to close from top to bottom in a slide effect. sap.ui.commons.Dialog When I tried closed method of Dialog

  • Issue with lost messages after updating....

    I was wondering if anyone could shed some light on the following.... I recently (...regretfully) completed the software update to v 20.0.019 via PC suite...before the update I made a back up of ALL files onto my SD card, which according to my backup

  • GPIB communication with GPIB (NI PCMCIA-GPIB)card in Visual Basic

    I have a old program in Visual Basic which works fine in windows 98 using the desktop, but using my laptop with windows 2000 on it and NI PCMCIA-GPIB card it fails to communicate and running the program does not recognize the sendIFC command. I am ne

  • Iphone Bluetooth Headset

    I just bought one maybe 2 weeks ago and the silly thing will not hold a charge, it says it's charged but when it is paired with my Iphone 3GS the battery icon shows less than a 1/4 charge on it........Whatsup with that? These things aren't cheap.....