Blob stored?

Hi,
When I insert a blob into Oracle database, I read/write the blob in chunk by chunk. I'd like to know how these chunks are stored in the database. We hold a big space and put all chunks together, OR each chunk stored at different space and they are linked together???
Please give an explanation how a blob is stored.
Thank you,
Minh

I would try to use the database, there you have the full control over your data.
There were some examples on asktom.oracle.com where you could see how to bring the blob back into the file system (with a Java Stored Procedure)

Similar Messages

  • Alternative method for displaying images blobs stored in DB

    I am trying to use an Application Process as a means to displaying images stored in BLOB columns in my table. And it works except for one problem. The code for my on-demand Application Process is below (the name of the application process is OUTPUT_IMAGE):
    DECLARE
    l_mime VARCHAR2(255);
    l_length NUMBER;
    l_file_name VARCHAR2(2000);
    lob_loc BLOB;
    BEGIN
    SELECT photo_mime_type,
    photo_blob,
    photo_filename,
    dbms_lob.getlength(photo_blob)
    INTO l_mime,
    lob_loc,
    l_file_name,
    l_length
    FROM persons
    WHERE id = <b>260</b>;
    owa_util.mime_header(nvl(l_mime,'application/octet'), FALSE);
    htp.p('Content-length: ' || l_length);
    htp.p('Content-Disposition: filename="' || l_file_name || '"');
    owa_util.http_header_close;
    wpg_docload.download_file(lob_loc);
    END;
    I can then create HTML like:
    &lt;img src="f?p=[my_app_id]:0:[the_session_id]:APPLICATION_PROCESS=OUTPUT_IMAGE"&gt;
    Which works nicely.
    The question/problem is: How can I pass the ID of the record (whose BLOB I want to display) to the Application Process? (In the code above you'll see the value of <b>260</b> is currently hard coded). I thought about tacking on something like "&my_id=xxx' to the end of the URL but doing so prevents the Application Process from even running.<BR/><BR/>
    All comments/suggestions much appreciated,<BR/><BR/>
    Thanks,
    <BR/>
    Andy

    Andrew,
    The URL for an Application Process uses the standard f?p syntax.
    Try passing your value like this:
    < img src="f?p=[my_app_id]:0:[the_session_id]:APPLICATION_PROCESS=OUTPUT_IMAGE:NO::MY_ID:[the value to send]"> You would need to have an item called MY_ID.
    Your query could then refer to it as
    WHERE id = :MY_ID;
    Doug

  • BLOBs stored in DB

    I have some files stored in the DB (11g) as Blobs...mostly images but some PDFs. The files are uploaded using an upload webpage, into a table like:
    CREATE TABLE wpg_document (
      NAME               VARCHAR(256)   UNIQUE NOT NULL,
      MIME_TYPE          VARCHAR(128),
      DOC_SIZE           NUMBER,
      DAD_CHARSET        VARCHAR(128),
      LAST_UPDATED       DATE,
      CONTENT_TYPE       VARCHAR(128),
      CONTENT            LONG RAW,
      BLOB_CONTENT       BLOB
    Using this Understanding mod_plsql as a reference to set this up.
    I use the PL/SQL Developer tool, and can "see" the BLOBs in this table (blob_content column), and they look fine.
    Now I am trying to provide the user a page to view or download the files. I think I'm running into charset issues, but not sure...all the above get stored as "ascii" in the DAD_CHARSET column (not sure why) ...our DB is UTF-8. (NLS_CHARACTERSET is AL32UTF8)
    On my "download" page, the PDFs come across as corrupt, and the images render all garbled (actually, the first 1/3 (the first 4086 bytes?) of the image shows fine, then it's all garbled). Here's the code snippet I'm using to fetch the BLOBs, which is the similar to a lot of what's out there on the web:
    lv_blob                      BLOB;
    v_amt NUMBER DEFAULT 4096;
    v_off NUMBER DEFAULT 1;
    v_raw RAW(4096);
    ..SELECT BLOB_CONTENT INTO lv_blob FROM wpg_document WHERE...
    BEGIN
           LOOP
             --dbms_output.put_line('Offset = '||v_off);
             -- Read the BLOB
             dbms_lob.READ(lv_blob, v_amt, v_off, v_raw);
             -- Display image
             htp.prn(utl_raw.cast_to_varchar2(v_raw));
             v_off := v_off + v_amt;
             v_amt := 4096;
           END LOOP;
           dbms_lob.CLOSE(lv_blob);
         EXCEPTION
           WHEN NO_DATA_FOUND THEN
             NULL;
         END;
    When I run this procedure straight from a PL/SQL Developer "test" window, I get an error (but no error when I browse to the download webpage)
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    it points to this line:
    htp.prn(utl_raw.cast_to_varchar2(v_raw));
    I'm not sure what's going on here...any ideas?
    tia

    Ihave narrowed this down a bit. When I change the offset (v_off) to other values (e.g., 1000, 2000, 32767) more or less of the images get garbled. So if I set to 2000, then the first 2000 bytes of the image seems OK, but everything after that is garbled (corrupt). Not sure why.
    Not sure this is a solution, nor why it works, but if I replace everything above between BEGIN and END with:
    wpg_docload.download_file(lv_blob);
    all works fine....dunno.

  • What is the file format for blobs stored for mds

    Does anyone know what type of file is stored into the blobs for a saved search/layout for mds in the streamed docs table? It doesn't appear to be xml, and looking at the a text version of whats in there it looks like its java code, but it isn't quite that.
    If anyone can point me in the right direction of being able to to turn the blob back into something human readable that would be great, as i would much rather be able to edit the blob than wipe out data.

    The data storage format for MDS data, while you may be able to figure it out or guess what it is by looking at it, is not published as far as I know. The only APIs that are published (again, as far as I know) are [url http://docs.oracle.com/cd/E23943_01/apirefs.1111/e14776/toc.htm]here
    Editing the data is at your own risk. You could always try raising a request with https://support.oracle.com asking for details, but I wouldn't bet anything of value on receiving the data you're asking for.

  • How to Display IMAGE BLOB stored in a table in a html region APEX

    Need to know how to display an image stored in a table in a HTML APEX Region.
    Please

    Hi
    Please explain what you mean by it doesn't work?
    Are there errors messages, at what point, how far did you get and exactly what did you do????
    Please provide more information.
    Thanks
    Ben

  • Report 6i and Blob

    Currently, I have a word document (BLOB) stored in a table.
    The goal is to fetch the BLOB and display the content of the word doc in the report.
    I've tried to add a report field which maps to the db column as Binary LOB with File Format property = 'text'. (I've also tried File Format property = OLE and few others. none of them works)
    All I am getting is bunch of scrambled character.
    What am I missing here?
    Thanks!

    I looked around Metalink and found...
    Unable to Display Complete MS-Word Document from Oracle Reports [ID 233445.1].
    It mentioned one work around is to transform the ms-doc to a text file.
    However, I am more interesting in what you mentioned earlier... "Split the original in several one page doc."
    Is there a programming way to achieve the goal for splitting the original doc in several pages while save into DB via Oracle Form? or do we just have to split the doc manually?
    Thanks.

  • Opening a pdf from a blob

    Hi Guys,
    I know this is a borderline ApEx problem but I have a page whose sole job is to open a pdf from a blob stored in the database.
    This code works for most client machines:
    DECLARE
    l_blob blob;
    BEGIN
    SELECT letter INTO l_blob
    FROM letters
    WHERE lett_id = :P44_LETT_ID;
    -- owa_util.mime_header('application/pdf',false);
    -- tried pdf and octet they work the same?????
    owa_util.mime_header('application/octet',false);
    htp.p('Content-Length: ' || dbms_lob.getlength(l_blob));
    owa_util.http_header_close;      
    wpg_docload.download_file(l_blob);
    END;
    On some machines I get 'Windows cannot open this file ...File: f[7] ...To open this file..........
    On most machines this works fine.
    I haven't got it to fail with Firefox yet, just IE but only a few machines running IE. Client getting annoyed and I starting to stress.
    Many thanks
    Gary

    Have you already tried adding
    htp.p('Content-Disposition:  attachment; filename...as described here?
    http://download.oracle.com/docs/cd/B32472_01/doc/appdev.300/b32469/up_dn_files.htm#CIHDDJGF
    Maybe it solves the problem, in case IE is a little bit picky. But I really don't know.
    Patrick
    My APEX Blog: http://inside-apex.blogspot.com
    The ApexLib Framework: http://apexlib.sourceforge.net
    The APEX Builder Plugin: http://sourceforge.net/projects/apexplugin/

  • View BLOBs in dw CS3 ?

    does Dreamweaver CS3 support binary images (also known as
    BLOBs) stored in a database?
    older versions didn't.
    or do i need to store images externally in my website and
    reference them with an image path stored in a text field?
    even if i could view BLOBs i suspect that internal storage
    could slow down the process of dispaying on a web page.
    using php/mysql.

    I think you just answered your own question.
    Am I wrong?
    "johnDough407" <[email protected]> wrote in
    message
    news:f5plvg$587$[email protected]..
    > does Dreamweaver CS3 support binary images (also known
    as BLOBs) stored in
    a
    > database?
    >
    > older versions didn't.
    >
    > or do i need to store images externally in my website
    and reference them
    with
    > an image path stored in a text field?
    >
    > even if i could view BLOBs i suspect that internal
    storage could slow
    down the
    > process of dispaying on a web page.
    >
    > using php/mysql.
    >

  • Downloading a PDF document via blob won't open start acrobat on click

    I'm experiencing a problem trying to get acrobat reader to open immediately when viewing a file stored as a blob is clicked. I am updating an old plsql webtoolkit app that stores pdf files in the database as a blob and displays them to the user in a frame. Download is achieved using wpg_docload.download_file() and the example provided by Oracle documentation. The download package body is:
    BEGIN
      l_filename := SUBSTR(OWA_UTIL.get_cgi_env('PATH_INFO'), 2);
    -- get mime type from db
      SELECT blob_content,
             mime_type
      INTO   l_blob_content,
             l_mime_type
      FROM   documents
      WHERE  name = l_filename;
    -- Add header
      HTP.init;
      OWA_UTIL.mime_header(l_mime_type, false);
      HTP.print('Content-Length: ' || DBMS_LOB.getlength(l_blob_content));
      HTP.print('Content-disposition: inline; filename="'|| l_filename ||'"');
      OWA_UTIL.http_header_close;
    -- get document 
      WPG_DOCLOAD.download_file(l_blob_content);
    EXCEPTION
      WHEN OTHERS THEN
        HTP.htmlopen;
        HTP.headopen;
        HTP.title('File Downloaded');
        HTP.headclose;
        HTP.bodyopen;
        HTP.header(1, 'Download Status');
        HTP.print('Download of ' || l_filename || ' failed.');
        HTP.print(SQLERRM);
        HTP.bodyclose;
        HTP.htmlclose;
    END download;All files will download okay but the acrobat container doesn't open right away and show a progress bar. It waits for the entire file to download, then opens the file. This becomes a bigger issue when the file size increases because it appears as though the site hangs until the document appears.
    If I place a file on a site directory instead of inside the database, create a link to it and click it, acrobat opens right away and displays progress. I want to get the site to open blob stored files in adobe right away and show download progress as if the file was stored on a site folder.
    Any ideas? Thanks

    Add this line to the content header
    HTP.print('Accept-Ranges: bytes');

  • Referencing report columns in the BLOB download link format mask

    Hi there,
    In a basic report (Apex 4) I have a link to download a BLOB stored in the table. However to save space, instead of using 2 columns, one for the file name and one for the download link, I want to use only one column where the file name is the download link itself.
    To do this, I tried using this download link format mask (ATTACH_FILENAME is the report column that contains the file name):
    DOWNLOAD:ATTACHMENTS:ATTACH_BLOB:ATTACHMENT_ID::ATTACH_MIME_TYPE:ATTACH_FILENAME:::attachment:#ATTACH_FILENAME#
    However it shows #ATTACH_FILENAME# in all rows instead of the actual file name!
    I know that using substitution strings (&) works, so is there a way to also reference report columns in this format mask?
    Thanks
    Luis

    Luis, did you finally resolve this? I have the same question.

  • Please help, I need to read blob and output in bytes from wwv_flow_files.

    Hi all,
    I am having a requirement to read a blob stored in the oracle table and convert it into bytes. I am loading this table (wwv_flow_files) with APEX.
    The code under page 1 is as follows:
    DECLARE
    z number;
    y varchar2(4000);
    x varchar2(400);
    b blob;
    BEGIN
    select filename,blob_content into x ,b from APEX_APPLICATION_files where name =:P1_FILE_NAME;
    select length(convertBlobToBytes(b)) into z from dual;
    :P1_RESULT := z;
    end;
    Java code is as follows:
    import java.io.*;
    import java.sql.Blob;
    public class convertBlob {
    * @param blob
    * @return
    public static byte[] convertBlobToBytes(Blob blob) {
    if (blob==null) return null;
    try {
    InputStream in = blob.getBinaryStream();
    int len = (int) blob.length(); //read as long
    long pos = 1; //indexing starts from 1
    byte[] bytes = blob.getBytes(pos, len);
    in.close();
    return bytes;
    catch (Exception e) {
    System.out.println(e.getMessage());
    return null;
    PL/SQL wrapper is as follows:
    CREATE OR REPLACE FUNCTION convertBlobToBytes(p1 IN BLOB) RETURN LONG RAW AUTHID CURRENT_USER AS LANGUAGE JAVA NAME 'convertBlob.convertBlobToBytes(java.sql.Blob) return byte[]';
    I loaded this java class and pl/sql wrapper into the database using JDEVELOPER.
    But I am getting the length of the file, as twice the size.
    For example, When I run the program which reads the file returns the length of the file as a byte array, the length is 819.
    When I pass the same file as a blob from apex, to the java program that converts blob to bytes, the length of the file is 1638.
    And hence I am getting wrong results, further in the process.
    Can you please help me? Any help is appreciated.
    rgds,
    Suma.

    The example on this page is showing how to read a blob in portions you determine yourself:
    http://apex.oracle.com/pls/otn/f?p=31517:91
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • How to read a BLOB (base64 - stream) from XML-file in ORACLE10

    ORACLE 10g
    PL/SQL function
    MY XML-file:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <slo xmlns="http://www.example.org/detection">
         <LekKey>1999_036371_509627</LekKey>
         <HuiNum>46</HuiNum>
         <Res></Res>
         <InfLig>TEST STRUI AFGESTORVEN - PLAANSTRAAT 46</InfLig>
         <XWGS>3.637028</XWGS>
         <YWGS>50.962667</YWGS>
         <Pei>EANDIS</Pei>
         <DatPei>1999-11-30T10:17:36.000+01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OILiIrRGq2Ia5N3vnnhq3z0VDGy24NLE/ErG39DIa8897Qt
    8DbuJg7XchOhK+Y3559MA8WlSvRLOS5W3ofUyCboleOgqt3KA6WFtjUaenxmiyloQOSDdbbqV5wy/qnk
    IR96hRTclbPSELjLFCIeH2ynJ818kMhAH/uQhy4LpLUFPFj6VRIb3l0RbMn/M7Q8b1vQfKvHz8RhmbHV
    RmILO64GRHxQ+4g877Vy7ODxkXnUwj1c//k0F1vko0ZaHgJzdW1hj8TfGUZPPWqCeLCB7J6HX/+OZpck
    bWxQSwECLQAUAAYACAAAACEAdD85esIAAAAoAQAAHgAAAAAAAAAAAAAAAADqNAkAY3VzdG9tWG1sL19y
    ZWxzL2l0ZW0xLnhtbC5yZWxzUEsBAi0AFAAGAAgAAAAhANouSfniAAAAVQEAABgAAAAAAAAAAAAAAAAA
    8DYJAGN1c3RvbVhtbC9pdGVtUHJvcHMxLnhtbFBLAQItABQABgAIAAAAIQD+hDirOAIAAMwHAAASAAAA
    AAAAAAAAAAAAADA4CQB3b3JkL2ZvbnRUYWJsZS54bWxQSwECLQAUAAYACAAAACEAp/3kQ44BAADeAgAA
    EQAAAAAAAAAAAAAAAACYOgkAZG9jUHJvcHMvY29yZS54bWxQSwECLQAUAAYACAAAACEAqchcqowAAADa
    AAAAEwAAAAAAAAAAAAAAAABdPQkAY3VzdG9tWG1sL2l0ZW0xLnhtbFBLAQItABQABgAIAAAAIQBgX/2I
    CwEAALoBAAAUAAAAAAAAAAAAAAAAAEI+CQB3b3JkL3dlYlNldHRpbmdzLnhtbFBLAQItABQABgAIAAAA
    IQDQwaCR/gEAAGgEAAAQAAAAAAAAAAAAAAAAAH8/CQBkb2NQcm9wcy9hcHAueG1sUEsFBgAAAAASABIA
    pQQAALNCCQAAAA==</Doc>
    </slo>
    I have to write an PL/SQL function where I can read all the data in the XML-file (see attach).
    In this XML there is a BLOB stored (base64 - stream -> that contains always a MSWORD document).
    1) how can I extract this BLOB + the other data in the XML and save this data in a ORACLE table?
    2) how can I decode this BLOB and save this MSWORD-document to a fileserver?

    First extract your data as CLOB (as it's character based)...
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select xmltype('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      2  <slo xmlns="http://www.example.org/detection">
      3    <LekKey>1999_036371_509627</LekKey>
      4    <HuiNum>46</HuiNum>
      5    <Res></Res>
      6    <InfLig>TEST STRUI AFGESTORVEN - PLAANSTRAAT 46</InfLig>
      7    <XWGS>3.637028</XWGS>
      8    <YWGS>50.962667</YWGS>
      9    <Pei>EANDIS</Pei>
    10    <DatPei>1999-11-30T10:17:36.000+01:00</DatPei>
    11    <Kan> </Kan>
    12    <Doc>UEsDBBQABgAIAAAAIQB5gHbnswEAAHcGAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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IQBgX/2ICwEAALoBAAAUAAAAAAAA
    AAAAAAAAAEI+CQB3b3JkL3dlYlNldHRpbmdzLnhtbFBLAQItABQABgAIAAAAIQDQwaCR/gEAAGgEAAAQAAAAAAAAAAAAAAAAAH8/CQBkb2NQcm9wcy9hcHAueG1sUEsFBgAAAAASABIApQQAALNCCQAAAA==</Doc>
    13  </slo>') as xml from dual)
    14  --
    15  -- end of test data
    16  --
    17  select x.*
    18  from   t
    19        ,xmltable(xmlnamespaces(default 'http://www.example.org/detection'),
    20                  '/slo'
    21                  passing t.xml
    22                  columns lekkey varchar(30) path './LekKey'
    23                         ,doc    clob        path './Doc'
    24*                ) x
    SQL> /
    LEKKEY                         DOC
    1999_036371_509627             UEsDBBQABgAIAAAAIQB5gHbnswEAAHcGAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAACAAAA
                                   AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
                                   AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
                                   AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
                                   AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
                                   AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
                                   AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
                                   AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
                                   AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
                                   AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC0VUtP20AQviP1P1h7rewNPVRVFYcDj2OL1FTluqzH
                                   ycK+tDMB8u8764AVwMSBiIsle/d7zLc74+nJg7PFHSQ0wdfiuJqIArwOjfGLWvydX5Q/RIGkfKNs8FCL
                                   NaA4mX05ms7XEbBgtMdaLIniTylRL8EprEIEzyttSE4Rv6aFjErfqgXIb5PJd6mDJ/BUUuYQs+kZtGpl
                                   qTh/4M8bJ9EvRHG62ZelamFcxufvchCRwOILiIrRGq2Ia5N3vnnhq3z0VDGy24NLE/ErG39DIa8897Qt
                                   8DbuJg7XchOhK+Y3559MA8WlSvRLOS5W3ofUyCboleOgqt3KA6WFtjUaenxmiyloQOSDdbbqV5wy/qnk
                                   IR96hRTclbPSELjLFCIeH2ynJ818kMhAH/uQhy4LpLUFPFj6VRIb3l0RbMn/M7Q8b1vQfKvHz8RhmbHV
                                   RmILO64GRHxQ+4g877Vy7ODxkXnUwj1c//k0F1vko0ZaHgJzdW1hj8TfGUZPPWqCeLCB7J6HX/+OZpck
                                   bWxQSwECLQAUAAYACAAAACEAdD85esIAAAAoAQAAHgAAAAAAAAAAAAAAAADqNAkAY3VzdG9tWG1sL19y
                                   ZWxzL2l0ZW0xLnhtbC5yZWxzUEsBAi0AFAAGAAgAAAAhANouSfniAAAAVQEAABgAAAAAAAAAAAAAAAAA
                                   8DYJAGN1c3RvbVhtbC9pdGVtUHJvcHMxLnhtbFBLAQItABQABgAIAAAAIQD+hDirOAIAAMwHAAASAAAA
                                   AAAAAAAAAAAAADA4CQB3b3JkL2ZvbnRUYWJsZS54bWxQSwECLQAUAAYACAAAACEAp/3kQ44BAADeAgAA
                                   EQAAAAAAAAAAAAAAAACYOgkAZG9jUHJvcHMvY29yZS54bWxQSwECLQAUAAYACAAAACEAqchcqowAAADa
                                   AAAAEwAAAAAAAAAAAAAAAABdPQkAY3VzdG9tWG1sL2l0ZW0xLnhtbFBLAQItABQABgAIAAAAIQBgX/2I
                                   CwEAALoBAAAUAAAAAAAAAAAAAAAAAEI+CQB3b3JkL3dlYlNldHRpbmdzLnhtbFBLAQItABQABgAIAAAA
                                   IQDQwaCR/gEAAGgEAAAQAAAAAAAAAAAAAAAAAH8/CQBkb2NQcm9wcy9hcHAueG1sUEsFBgAAAAASABIA
                                   pQQAALNCCQAAAA==
    SQL>Then, you can convert the CLOB to a BLOB by doing your base64 decoding.

  • Rendering the content of a blob from discoverer

    Hi Gurus,
    I've got to render, on the web browser, the contents of a blob stored in a table. I don't know, at design time, the type/mime of the blob's content, It's actually stored aside the blob in another column of the same table.
    It could be sufficent, for me, presenting a link and asking the user to click on it.
    What's the way I can realize this?
    Thanks in advance
    Norberto
    PS: My skill is mainly on forms/reports... I'm not an ace in Discoverer technology...

    Hi,
    You have got 2 options here. You can create a data item for each mime type and have a column for each mime type in the report. Each row would have a link in one of the columns. You will have to create a view or custom folder over your blob table with additional columns for each mime type, for example to create an extra column for Excel:
    SELECT ...,
    CASE WHEN mime_type = 'application/vnd.ms-excel' THEN blob_content END blob_exel
    FROM blob_table
    Then set the content_type in the properties of the folder to be XLS for blob_excel column. The user would then have to click on the column which had been populated with the link.
    The other option is to write your own mod_plsql procedure to download the blob. It is quite simple, you need to call owa_util.mime_header to set the mime type and wpg_docload.download_file to download the blob. You then create a hyperlink to your mod_plsql procedure.
    Hope that helps,
    Rod West

  • Plesae help- needing to read a blob from db into bytes[]

    Hi all,
    I am having a requirement to read a blob stored in the oracle table and convert it into bytes. I am loading this table (wwv_flow_files) with APEX.
    The code under page 1 is as follows:
    DECLARE
    z number;
    y varchar2(4000);
    x varchar2(400);
    b blob;
    BEGIN
    select filename,blob_content into x ,b from APEX_APPLICATION_files where name =:P1_FILE_NAME;
    select length(convertBlobToBytes(b)) into z from dual;
    :P1_RESULT := z;
    end;
    Java code is as follows:
    import java.io.*;
    import java.sql.Blob;
    public class convertBlob {
    * @param blob
    * @return
    public static byte[] convertBlobToBytes(Blob blob) {
         if (blob==null) return null;
         try {
         InputStream in = blob.getBinaryStream();
         int len = (int) blob.length(); //read as long     
    long pos = 1; //indexing starts from 1
         byte[] bytes = blob.getBytes(pos, len);           
    in.close();
         return bytes;     
    catch (Exception e) {
         System.out.println(e.getMessage());
         return null;
    PL/SQL wrapper is as follows:
    CREATE OR REPLACE FUNCTION convertBlobToBytes(p1 IN BLOB) RETURN LONG RAW AUTHID CURRENT_USER AS LANGUAGE JAVA NAME 'convertBlob.convertBlobToBytes(java.sql.Blob) return byte[]';
    I loaded this java class and pl/sql wrapper into the database using JDEVELOPER.
    But I am getting the length of the file, as twice the size.
    For example, When I run the program which reads the file returns the length of the file as a byte array, the length is 819.
    When I pass the same file as a blob from apex, to the java program that converts blob to bytes, the length of the file is 1638.
    And hence I am getting wrong results, further in the process.
    Can you please help me? Any help is appreciated.
    rgds,
    Suma.

    Hi all,
    Can any of you please help me out?
    rgds,
    Suma.

  • Embed blob object into HTML region

    Hi everyone!
    I am interested in embedding a .swf file into an HTML region in ApEx. It's real easy when the source is a file or http server. However, could this be done if the source was a blob stored in the database?
    Below is the code that works for me now in the HTML region, but I wonder if I could get the embed code to extract the source file from the database instead of a file server.
    <object width="1024" height="768">
    <param name="movie" value="http://webfiles.abc.com/level2/some_xcelsius_dashboard.swf">
    <embed src="http://webfiles.abc.com/level2/some_xcelsius_dashboard.swf" width="1024" height="768">
    </embed>
    </object>
    Thanks!!!
    -Rudy

    Hi
    Yes, that is easily done. See this doc on how to download a blob from a table:
    Link
    When you have created your download function, put a reference to it in the src= parameter.
    Luis

Maybe you are looking for

  • If i create a new itunes account can i transfer my songs, games, movies, etc. to my new account

    If I create a new account can I transfer all of my songs, games, movies etc. to the new one?

  • Delivery Split for PO

    I want to split delivery creation for 'NL' type of delivery for STPO i.e. 'UB' type. i.e. if a PO has 2 materials with different material types ( e.g FERT & HAWA ), then 2 different deliveries have to be created in this case automatically. How can th

  • Streaming Fox News

    Every morning I like to stream Fox and Friends on my PC while working from home on my laptop.  As the program progresses in and out of commercials, many times I have to refresh the window to get back to the program and not watch the commercial break

  • ALV Block Display with filet ............ Urget Please..............

    Hello All, Hello All, I am Working on ALV Block List Report. In that report i am having two Blocks. if i set a filter for one block it is filtering that block, the second block remains constant. My requirment is like this if iam setting a filter for

  • Get.add name parameter has 15 character limit??

    Hi, can you confirm the limit on the name parameter string is 15 characters. Its taken me a while to debug my code and narrow it down to the fact that my application level item name that i am updating via get.add is 16 characters long. If i reduce th