Displaying BLOBs

Recently i've been working on a rather modest application, which lists contacts. When a detail-link was clicked, a popup would come up with more details and an image of that contact.
The table this was based on contained a column photo_reference, which held a path to a folder under /i/. With this setup, it was easy to get the images working for each contact.
The popup i showed was a bunch of htmlcode i put in the region footer, and hid. When the detail was clicked, i retrieved data via an application process, and show a modal dialog.
Now the scope has changed: users need to be able to upload their own images. So, i went to work and made it so the images get uploaded into wwv_flow_files, and then i move them to a new contact_image table. So far so good. But now i want to display these pictures, and here i'm kind of stuck.
* I could include a column in my IR, and put a blob format mask on it with image. I've got this working, but annoyingly. My image table has as primary key the field 'ID'. My contacts table also has 'ID' as PK.
The format mask: IMAGE:APXT_CONTACTS_IMG:SMALL_PHOTO:ID::::::inline:.
Here the PK field (ID) works with the PK of my base table (contacts). My link between tables is apxt_contacts.contact_image_id->apxt_contacts_img.id . The way i could make it work is to rename my id field in the image table to contact_image_id. (why couldnt it just take the column it's based on as the value :( ). I could then hide the column, and take the image with javascript to show in my popup. Also, this way preloads all images for the amount of selected rows.
* get_blob_file_src also seems no use to me because of the limited use of the parameters (page items required etc).
* I'd much rather be able to get the image blob via ajax to then display in my popup, but i have no clue as to how to do this. I've made a stored procedure which gets the file to download and call this from an application process (ajax callback), and with firebug i can see the post/response, but i wouldn't know how to get this displayed as an image.
begin
SELECT mime_type, lengthb(small_photo), filename, small_photo
INTO v_mime, v_length, v_filename, v_lob
FROM apxt_contacts_img
WHERE id = p_contact_image_id;
OWA_UTIL.mime_header (NVL (v_mime, 'application/octet'), FALSE);
HTP.p ('Content-length: ' || v_length);
OWA_UTIL.http_header_close;
wpg_docload.download_file (v_lob);
end;
This way i'd only have to load the pictures of links clicked.
I'd rather not have to grant execute to public and call the stored procedure via the link, but if this is my only route, id rather go solve it the first way.
Instead of my existing code, should i make this work through creating another page, and juggle page items and their values around to try and get the same layout going, and then get that page through ajax? This would also mean extra work, im trying to minimize impact (=work) on the existing app.
tl;dr: is it possible to retrieve an image blob from a table not in the report query, preferably through ajax?
This is Apex 4.02 on an 11g db
Thanks,
Tom (handle pending :) )

Our clients are a mixture of everything from Win98 to XP, including some Macs. There's no single place on every client I can be guranteed to have write access to. Many of our Windows users don't have write access to most of their C: drive, for exqample. Our Windows users have a standard F: drive on the network, but our Mac users don't.
So I would have to ask them via a file requestor where to save the file to for viewing. And since WEB.SHOW_DOCUMENT needs a URL anyway, it seemed it would be more "transparent" to the user to move the BLOB file invisibly to the Apache server and launch it from there.
My guess is there's an Oracle BLOB utility out there that writes a BLOB back to a disk file. I'm just new to the whole BLOB process and am hoping someone could get me pointed in the right direction.
Dave

Similar Messages

  • Problem with displaying BLOB images on JSP page using a servlet

    hi. I have a big problem with displaying BLOB images using JSP. I have a servlet that connects to the oracle database, gets a BLOB image , reads it, and then displays it using a BinaryStream. The problem is , this works only when i directly call that servlet, that is http://localhost:8080/ImageServlet. It doesn't work when i try to use that servlet to display my image on my JSP page (my JSP page displays only a broken-image icon ) I tried several coding approaches with my servlet (used both Blob and BLOB objects), and they work just fine as long as i display images explicitly using only the servlet.
    Here's what i use : ORACLE 10g XE , Eclipse 3.1.2, Tomcat 5.5.16 , JDK 1.5
    here is one of my image servlet's working versions (the essential part of it) :
                   BLOB blob=null;
              rset=st.executeQuery("SELECT * FROM IMAGES WHERE ID=1");
              while (rset.next())
                   blob=((OracleResultSet)rset).getBLOB(2);
              response.reset();
              response.setContentType("image/jpeg");
              response.addHeader("Content-Disposition","filename=42.jpeg");
                    ServletOutputStream ostr=response.getOutputStream();
                   InputStream istr=blob.getBinaryStream(1L);
                    int size=blob.getBufferSize();
              int len=-1;
                    byte[] buff = new byte[size];
                         while ((len=istr.read( buff ))!=-1 ) {
                   ostr.write(buff,0,len);
             response.flushBuffer();
             ostr.close(); and my JSP page code :
    <img src="/ImageServlet" border="0"  > If you could just tell me what i'm doing wrong here , or if you could show me your own solutions to that problem , i would be very greatful ,cos i'm realy stuck here , and i'm rather pressed for time too. Hope someone can help.

    I turns out that it wasn't that big of a problem after all. All i had to do was to take the above code and place it into another JSP page instead of into a servlet like i did before. Then i just used that page as a source for my IMG tag in my first JSP. It works perfectly well. Why this doesn't work for servlets i still don't know, but it's not a problem form me anymore . Ofcourse if someone knows the answer , go ahead and write. I would still appriceatte it.
    here's the magic tag : <img src="ImageJSP.jsp" border="0"  > enjoy : )

  • Display BLOB (image) column in (interactive) report

    Hi,
    I have a field called "picture" in my table "details" which is of type BLOB. i also have a field for "MIMETYPE" and "filename"
    i additionally have a "name" and "description" columns which i need to display along with the picture as columns in a report (preferably interactive).
    i have also modified the BLOB display format as per
    http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/apex/r31/apex31nf/apex31blob.htm
    what i am missing is the correct query. if possible, i would like to control the size of the picture rendered within the report like say 40*50.
    I have also referred to the thread
    APEX 3.1 Display BLOB Image
    But i don't know how to place the
    dbms_lob.getlength("BLOB_CONTENT") as "BLOB_CONTENT"
    in my query.
    The above also makes the report column as of type "number". is this expected?
    Any help would be much appreciated.
    Regards,
    Ramakrishnan

    You haven't actually said what the problem is?
    >
    I have a field called "picture" in my table "details" which is of type BLOB. i also have a field for "MIMETYPE" and "filename"
    i additionally have a "name" and "description" columns which i need to display along with the picture as columns in a report (preferably interactive).
    i have also modified the BLOB display format as per
    http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/apex/r31/apex31nf/apex31blob.htm
    what i am missing is the correct query.
    I have also referred to the thread
    APEX 3.1 Display BLOB Image
    But i don't know how to place the
    dbms_lob.getlength("BLOB_CONTENT") as "BLOB_CONTENT"
    >
    Something like:
    select
              name
            , description
            , dbms_lob.getlength(picture) picture
    from
              details
    if possible, i would like to control the size of the picture rendered within the report like say 40*50.For images close to this size it's easy to do this for declarative BLOB images in interactive reports using CSS. Add a style sheet with:
    .apexir_WORKSHEET_DATA td[headers="PICTURE"] img {
      display: block;
      width: 40px;
      border: 1px solid #999;
      padding: 4px;
      background: #f6f6f6;
    }where the <tt>PICTURE</tt> value in the attribute selector is the table header ID of the image column. Setting only one dimension (in this case the width) scales the image with the correct aspect ratio. (The border, padding and background properties are just eye candy...)
    However, scaling large images in the browser this way is a huge waste of bandwidth and produces poorer quality images than creating proper scaled down versions using image tools. For improved performance and image quality, and where you require image-specific scaling you can use the database ORDImage object to produce thumbnail and preview versions automatically, as described in this blog post.

  • I want to display BLOB image in JSP Using  html tags IMG src=

    GoodAfternoon Sir/Madom
    I Have got the image from oracle database but want to display BLOB image using <IMG src="" > Html tags in JSP page . If it is possible than please give some ideas or
    Send me sample codes for display image.
    This code is ok and working no problem here Please send me code How to display using html tag from oracle in JSP page.
    <%@ page import="java.sql.*" %>
    <%@ page import="java.io.*" %>
    <%@ page import="javax.swing.ImageIcon;" %>
          <%
            out.print("hiiiiiii") ;
                // declare a connection by using Connection interface
                Connection connection = null;
                /* Create string of connection url within specified format with machine
                   name, port number and database name. Here machine name id localhost
                   and database name is student. */
                String connectionURL = "jdbc:oracle:thin:@localhost:1521:orcl";
                /*declare a resultSet that works as a table resulted by execute a specified
                   sql query. */
                ResultSet rs = null;
                // Declare statement.
                PreparedStatement psmnt = null;
                  // declare InputStream object to store binary stream of given image.
                   InputStream sImage;
                try {
                    // Load JDBC driver "com.mysql.jdbc.Driver"
                    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
                        /* Create a connection by using getConnection() method that takes
                        parameters of string type connection url, user name and password to
                        connect to database. */
                    connection = DriverManager.getConnection(connectionURL, "scott", "root");
                        /* prepareStatement() is used for create statement object that is
                    used for sending sql statements to the specified database. */
                    psmnt = connection.prepareStatement("SELECT image FROM img WHERE id = ?");
                    psmnt.setString(1, "10");
                    rs = psmnt.executeQuery();
                    if(rs.next()) {
                          byte[] bytearray = new byte[1048576];
                          int size=0;
                          sImage = rs.getBinaryStream(1);
                        //response.reset();
                          response.setContentType("image/jpeg");
                          while((size=sImage.read(bytearray))!= -1 ){
                response.getOutputStream().write(bytearray,0,size);
                catch(Exception ex){
                        out.println("error :"+ex);
               finally {
                    // close all the connections.
                    rs.close();
                    psmnt.close();
                    connection.close();
         %>
         Thanks

    I have done exactly that in one of my applications.
    I have extracted the image from the database as a byte array, and displayed it using a servlet.
    Here is the method in the servlet which does the displaying:
    (since I'm writing one byte at a time, it's probably not terribly efficient but it works)
         private void sendImage(byte[] bytes, HttpServletRequest request, HttpServletResponse response) throws IOException {
              ServletOutputStream sout = response.getOutputStream();
              for(int n = 0; n < bytes.length; n++) {
                   sout.write(bytes[n]);
              sout.flush();
              sout.close();
         }Then in my JSP, I use this:
    <img src="/path-to-servlet/image.jpg"/>
    The name of the image to display is in the URL as well as the path to the servlet. The servlet will therefore need to extract the image name from the url and call the database.

  • Display blob content as pdf file

    Dear Expert,
    Currently i'm using oracle apex 3.0.1.
    I'm having a problem on displaying blob content (from database table) as pdf file on oracle application express but i'm able to save to download the pdf.
    Below is the procedure that i used to display blob content,
    PROCEDURE lf_html_pdf (pv_image IN VARCHAR2, pv_index IN NUMBER) is
    l_mime VARCHAR2 (255);
    l_length NUMBER;
    l_file_name VARCHAR2 (2000);
    lob_loc BLOB;
    BEGIN
    begin
    selecT OI_BLOB,DBMS_LOB.getlength (OI_BLOB)
    into lob_loc,l_length
    from ord_img
    where oi_tno= pv_image
    and oi_ti='PDF'
    and oi_idx=pv_index;
    exception
    when others then
    null;
    end;
    OWA_UTIL.mime_header (NVL (l_mime, 'application/pdf'), FALSE);
    HTP.p ('Content-length: ' || l_length);
    OWA_UTIL.http_header_close;
    WPG_DOCLOAD.download_file (lob_loc);
    END lf_html_pdf;
    I get the error message as below when i execute the procedure above;
    Error report:
    ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at "SYS.OWA_UTIL", line 356
    ORA-06512: at "SYS.OWA_UTIL", line 415
    ORA-06512: at "HCLABPRO.PKG_PDF", line 220
    ORA-06512: at line 2
    *06502. 00000 - "PL/SQL: numeric or value error%s"*
    I'm appreciated if expert can have me on the problem above?
    Thanks
    From junior

    *Always post code wrapped in <a href=http://wikis.sun.com/display/Forums/Forums+FAQ#ForumsFAQ-Arethereanyusefulformattingoptionsnotshownonthesidebar?"><tt>\...\</tt> tags</a>:*
      PROCEDURE lf_html_pdf (pv_image IN VARCHAR2, pv_index IN NUMBER) is
         l_mime        VARCHAR2 (255);
         l_length      NUMBER;
         l_file_name   VARCHAR2 (2000);
         lob_loc       BLOB;
      BEGIN
          begin
            selecT OI_BLOB,DBMS_LOB.getlength (OI_BLOB)
            into lob_loc,l_length
            from ord_img
            where  oi_tno= pv_image
              and oi_ti='PDF'
              and oi_idx=pv_index;
          exception
                when others then
                null;
            end;
         OWA_UTIL.mime_header (NVL (l_mime, 'application/pdf'), FALSE);
         HTP.p ('Content-length: ' || l_length);
         OWA_UTIL.http_header_close;
         WPG_DOCLOAD.download_file (lob_loc);
      END lf_html_pdf; Start by getting rid of:
          exception
                when others then
                null;and never using it anywhere ever again.
    If you're not actually going to use the <tt>l_mime</tt> and <tt>l_file_name</tt> variables then remove these as well. (Although I really think you should set a filename.)
    >
    Error report:
    ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at "SYS.OWA_UTIL", line 356
    ORA-06512: at "SYS.OWA_UTIL", line 415
    ORA-06512: at "HCLABPRO.PKG_PDF", line 220
    ORA-06512: at line 2
    06502. 00000 - "PL/SQL: numeric or value error%s"
    >
    The error stack indicates that the exception is being raised in <tt>HCLABPRO.PKG_PDF</tt>: what is <tt>HCLABPRO.PKG_PDF</tt>? Does this actually have anything to do with the procedure above?
    I get the error message as below when i execute the procedure above;How do you execute it?
    What happens when it's executed without the <tt>when others...</tt> built-in bug?

  • Displaying BLOB of type word doc in XML Publisher pdf output

    Hi all,
    Please guide me relating the Displaying BLOB of type word doc in XML Publisher pdf output with links or pointers.In the following xml column TRADE_LICENSE_COPY is BLOB when queried from toad and if clicked on the ouput word doc is being opened directly.How to show the column value word doc as attachment in pdf output?
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Generated by Oracle Reports version 10.1.2.3.0 -->
    <XXTDIC_SUP_REG>
    <LIST_G_BASIC_QUSNRY>
    <G_BASIC_QUSNRY>
    <RESPONSE_ID>194</RESPONSE_ID>
    <UAE_REGISTRATION>Yes</UAE_REGISTRATION>
    <TRADE_LICENSE_COPY>PK</TRADE_LICENSE_COPY>
    <WEBSITE_DETAILS>com</WEBSITE_DETAILS>
    <AMERICA_2009_2010>Between 81 and 90 %</AMERICA_2009_2010>
    </G_BASIC_QUSNRY>
    </LIST_G_BASIC_QUSNRY>
    <LIST_G_CONTACTS>
    <G_CONTACTS>
    <CONTACT_PERSON>MR.NTF1 NTL1</CONTACT_PERSON>
    <PHONE_NUMBER>0</PHONE_NUMBER>
    <EMAIL_ID>na</EMAIL_ID>
    <FAX_NUMBER>0</FAX_NUMBER>
    </G_CONTACTS>
    <G_CONTACTS>
    <CONTACT_PERSON>MR.NTF1 NTL1</CONTACT_PERSON>
    <PHONE_NUMBER>0</PHONE_NUMBER>
    <EMAIL_ID>na</EMAIL_ID>
    <FAX_NUMBER>-</FAX_NUMBER>
    </G_CONTACTS>
    </LIST_G_CONTACTS>
    <LIST_G_SC_QUSNRY>
    <G_SC_QUSNRY>
    <RESPONSE_ID1>113</RESPONSE_ID1>
    <FY3_PROJTYPE_COMMERCIAL>Between 21 and 30 %</FY3_PROJTYPE_COMMERCIAL>
    <ENG_INSTALL_CAPABILITY></ENG_INSTALL_CAPABILITY>
    <SCM_EXPERIENCE_PARTNERING>Have you had experience of &quot;Partnering&quot;?(i.e with major contracts / employers If so list them.Also please provide details</SCM_EXPERIENCE_PARTNERING>
    </G_SC_QUSNRY>
    </LIST_G_SC_QUSNRY>
    <LIST_G_ADDRESS>
    <G_ADDRESS>
    <OFFICE_ADDRESS>Addres1</OFFICE_ADDRESS>
    <ADDRESS_LINE1>Addre line1</ADDRESS_LINE1>
    <ADDRESS_LINE2>Addre line2</ADDRESS_LINE2>
    <ADDRESS_LINE3>Addre line3</ADDRESS_LINE3>
    <CITY>City1</CITY>
    <STATE>State1</STATE>
    <COUNTRY>US</COUNTRY>
    </G_ADDRESS>
    <G_ADDRESS>
    <OFFICE_ADDRESS>Addres2</OFFICE_ADDRESS>
    <ADDRESS_LINE1>Addre line1</ADDRESS_LINE1>
    <ADDRESS_LINE2>Addre line2</ADDRESS_LINE2>
    <ADDRESS_LINE3>Addre line3</ADDRESS_LINE3>
    <CITY>City2</CITY>
    <STATE>State2</STATE>
    <COUNTRY>IN</COUNTRY>
    </G_ADDRESS>
    </LIST_G_ADDRESS>
    <LIST_G_DSN_QUSNRY>
    </LIST_G_DSN_QUSNRY>
    <LIST_G_PROD_SUB_CODE>
    <G_PROD_SUB_CODE>
    <PROD_SUB_CODE>060.42</PROD_SUB_CODE>
    <PROD_SUB_DESC>Automotive Maintenance Items and Repair/Replacement Parts.Filters: Air, Fuel, Oil, Power Steering, Transmission and Water, and PCV Valves</PROD_SUB_DESC>
    </G_PROD_SUB_CODE>
    <G_PROD_SUB_CODE>
    <PROD_SUB_CODE>060.60</PROD_SUB_CODE>
    <PROD_SUB_DESC>Automotive Maintenance Items and Repair/Replacement Parts.Hose and Hose Fittings: Brake, Heater, Radiator, Vacuum, Washer, Wiper, etc.</PROD_SUB_DESC>
    </G_PROD_SUB_CODE>
    <G_PROD_SUB_CODE>
    <PROD_SUB_CODE>207.37</PROD_SUB_CODE>
    <PROD_SUB_DESC>Computer Accessories and Supplies.CRT Holders, Cases, Glare Screens, Locks, etc.</PROD_SUB_DESC>
    </G_PROD_SUB_CODE>
    <G_PROD_SUB_CODE>
    <PROD_SUB_CODE>207.60</PROD_SUB_CODE>
    <PROD_SUB_DESC>Computer Accessories and Supplies.Keyboard Dust Covers, Key Top Covers, Keyboard Drawers, Wrist Supports, etc.</PROD_SUB_DESC>
    </G_PROD_SUB_CODE>
    </LIST_G_PROD_SUB_CODE>
    <LIST_G_CONT_QUSNRY>
    </LIST_G_CONT_QUSNRY>
    <LIST_G_BUSS_CLASS>
    <G_BUSS_CLASS>
    <BUSS_CLASS>SUPPLY_CHAIN</BUSS_CLASS>
    </G_BUSS_CLASS>
    </LIST_G_BUSS_CLASS>
    <CF_SUPPLIER_NAME>N1</CF_SUPPLIER_NAME>
    <CF_REG_STATUS>Draft</CF_REG_STATUS>
    <CF_BUS_CLASS></CF_BUS_CLASS>
    <CF_PROD_SUBCODE>060.36</CF_PROD_SUBCODE>
    <CF_PROD_SUBCODE_MEAN>Automotive Maintenance Items and Repair/Replacement Parts.Electrical Accessories: Alternators, Ammeters, Coils, Distributors, Generators, Regulators, Starters, etc.</CF_PROD_SUBCODE_MEAN>
    <CF_COUNTRY>India</CF_COUNTRY>
    </XXTDIC_SUP_REG>
    Thanks in advance.
    Best Regards,
    Mahi

    Mahi,
    you can't do that yet.

  • How to display blob as text in APEX

    hi All,
    I am developing an apex application using the apex cloud (apex.oraclecorp.com). I am using the DB link to show the data on APEX UI. I have a blob data which is stored in the remote DB, and I want to display the BLOB data as text on a popup or a new page or a download link.
    I tried using display only item but APEX throws an error saying that remote DB is not supported. Also, It would be great if I can just show a download link on the UI for the BLOB data, again when I try to select the format as BLOB in the column attributes, When I give the table@dblink as BLOB table I get an error saying that "table@DBLINK not found".
    Is there any way to display the BLOB data as text or download it which is present in my local DB?
    Please help me out.
    Thanks

    2f75c9f8-5675-4cdb-9224-e5c4b5f19bd1 wrote:
    hi All,
    I am developing an apex application using the apex cloud (apex.oraclecorp.com). I am using the DB link to show the data on APEX UI. I have a blob data which is stored in the remote DB, and I want to display the BLOB data as text on a popup or a new page or a download link.
    I tried using display only item but APEX throws an error saying that remote DB is not supported. Also, It would be great if I can just show a download link on the UI for the BLOB data, again when I try to select the format as BLOB in the column attributes, When I give the table@dblink as BLOB table I get an error saying that "table@DBLINK not found".
    Is there any way to display the BLOB data as text or download it which is present in my local DB?
    I don't think your question is clear enough. can you be more specific about what you are trying to achieve and also provide proper information about your apex & database version.
    What you mean by displaying blob as text?? What is stored in your blob columns?
    read 17.10 About BLOB Support in Forms and Reports

  • Display BLOBS

    I am trying to display BLOBS in HTMLDB using Report. I am not able to display images, PDF or Docs.
    I am using the following procedure DISPLAY_IMAGE
    create or replace procedure "DISPLAY_IMAGE"
    (p_image_id IN NUMBER)
    is
    l_mime varchar2(255);                
    l_length number;
    l_file_name varchar2(2000);
    lob_loc BLOB;
    begin
    select mime_type,image_data, file_name, dbms_lob.getlength(image_data)
    into l_mime, lob_loc, l_file_name, l_length
    from image_table where image_id = p_image_id;
                                       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 tried building with the following region source in the Report
    select
    '<iframe src="#OWNER#.display_image?p_image_id=&i.image_id." width=300> </iframe>' img, image_id, file_name, mime_type from image_table i
    Any ideas???

    Does accessing #OWNER#.display_image?p_image_id=&i.image_id. directly via your browser work if you replace &image_id. and #OWNER# with valid values (i.e. is a popup window displayed asking you to save or open the file)? If this works then...
    The HTTP header output by the following line tells a browser to popup the "Save to disk" dialog.
    htp.p('Content-Disposition: filename="' || l_file_name || '"');
    If you are wanting to just display the content of the file (e.g. image, pdf etc.) in the browser you will want to remove that line.
    [ BTW, I am not sure if you can set the src attribute of the IFRAME tag to be an image. PDFs should work though I think ]

  • Displaying BLOB image by using ADF Faces

    Hi all,
    I digged the forum but couldn't find any satisfied answer about displaying BLOB images by using ADF Faces.
    I have insterted POJO object to Oracle database but couldn't find any way to display blob (in java byte [] ) data in POJO.
    I have read the POJO object from database which contains two field; one of them is id field and other is BLOB data which holds GIF or JPG image and I want to display this image another page which contains also other fields / records ...
    thanks for your answers
    regards...
    --baris                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    This thread at Sun : http://forum.java.sun.com/thread.jspa?threadID=513804&messageID=2445090
    talks about two options for creating a graphicImage jsf tag. (img tag)
    1. Make the img tag url refer to a servlet (instead of a static image file)
    2. Embed the image into the tag as inline base64 encoded data.
    2a. Use an <Object> tag with inline data.
    1. Looks a bit complex for a simple problem.
    2 and 2a don't work with some browsers.
    - And I've not yet figured out how to hook into the ADF Faces table-rendering logic to get it to add my image column. My table binds to a collection DataControl, [which in turn retrieves from a findAllItems call on a session facade, which uses my domain model, and wraps up access to a TopLink pesistence layer]. The framework just ignores my byte[] attribute when creating the jsf table from the DataControl. All string, int etc. attributes get represented correctly in the jsf table output.

  • Displaying BLOB value

    Hello,
    Working on Oracle 10G R2/Windows
    There is a way to display BLOB value from SQL*PLUS or other tools?
    Thank for your help

    from sql*plus you can only display first 32767 character from the blob ,however you can write to file using pl/sql and read that file.
    DECLARE
    l_file UTL_FILE.FILE_TYPE;
    l_buffer RAW(32767);
    l_amount BINARY_INTEGER := 32767;
    l_pos INTEGER := 1;
    l_blob BLOB;
    l_blob_len INTEGER;
    cursor c1 is SELECT RAWCONTENT FROM BLOCK;
    BEGIN
    -- Get LOB locator
    -- Open the destination file.
    l_file := UTL_FILE.fopen('BLOBS','Myfile.lst','w', 32767);
    open c1;
    loop
    fetch c1 into l_blob;
    exit when c1%notfound;
    l_blob_len := DBMS_LOB.getlength(l_blob);
    -- Read chunks of the BLOB and write them to the file
    -- until complete.
    WHILE l_pos < l_blob_len LOOP
    DBMS_LOB.read(l_blob, l_amount, l_pos, l_buffer);
    UTL_FILE.put_raw(l_file, l_buffer, TRUE);
    l_pos := l_pos + l_amount;
    END LOOP;
    end loop;
    -- Close the file.
    UTL_FILE.fclose(l_file);
    EXCEPTION
    WHEN OTHERS THEN
    -- Close the file if something goes wrong.
    IF UTL_FILE.is_open(l_file) THEN
    UTL_FILE.fclose(l_file);
    END IF;
    RAISE;
    END;
    /

  • Help, how to open and display blobs from tables

    Dear all,
    I am trying to store ms-word files on a table using a blob column.
    Does anyone how to open the files and display them from a form using 9iAS?
    Thank you.
    Carlos.

    And there may be, but you won't likely find that here. Do some time searching Google and maybe you'll find code that someone was nice enough to make freely available, although I wouldn't count on it. Were i a programmer and took the time to read those docs and write the code, I'd want to be paid for my time. But there are a lot of programmers who swear by freeware! You may get lucky.

  • Can not display BLOB in a REPORT Portal 3.0.9

    I had created a table witha blob field.
    I want to display this field in a report to display the documento from the aplicaction.
    What can i do ?

    Hi,
    BLOBs are not supported in reports as of now.
    Thanks,
    Sharmila

  • Display blob in bi publisher

    I have a report that I"m trying to display an image at runtime. I create the data template, then the word template.
    In the word template I have tried:
    1. Tried adding the code to the a text form field (form fileld text help)
    2. Straight to the word rtf template:
    <fo:instream-foreign-object content type="image/gif" height="3 in" width="4 in">
    <xsl:value-of select="IMAGE_DATA"/> (also used select="IMAGEDATA"
    </fo:instram-foreign-object>
    3. also placed the text in #2 above in a property sheet in the word template called Bi PUblisher Properties (Code)
    None of these have worked.
    the MIME type is image/gif. My data template looks like this:
    <dataTemplate name="Image" description="Image" dataSourceRef="DEV">
         <parameters>
              <parameter name="p_image" dataType="character" defaultValue="2393"/>
         </parameters>
         <dataQuery>
              <sqlStatement name="Q1">
                   <![CDATA[select PENCMMD.PENCMMD_IMAGE_DATA IMAGE_DATA
    from      MYIMAGE.PENCMMD PENCMMD
    where       PENCMMD.PENCMMD_CMMD_ID =2393]]>
              </sqlStatement>
         </dataQuery>
         <dataStructure>
              <group name="G_Proposal" source="Q1">
                   <element name="ImageData" value="image_data"/>
              </group>
         </dataStructure>
    </dataTemplate>

    I'm also looking for the same requirement to display a signature(BLOB) field on an existing Data template report but getting the error - '
    ORA-00932: inconsistent datatypes: expected - got BLOB' when selected the signature field in my select statement. Please guide me into the right direction. Thanks.

  • How do I display blob (image) in a Portal Report

    I am using 9ias 10222 and portal 30983 and I have a table that stores an image as a blob and have a varchar field to store the mime type. I have created a form to upload the image and can then query the form to display the image.
    How do I dislay the image in a Portal Report/Dynamic Page Component. I have followed note 68016.1 but the retrieve_img_data procedure does not work it gives a wwv-11230 error.
    Any ideas? Any help would be appreciated.
    Thanks
    Belinda

    Hi,
    Can you display what code you used for this? I followed note 172045.1 and everything compiles properly but when I run the report, I just get a box with a red X in it, like it is not finding the picture. I ran the procedure that downloads the image and it works fine from there. Thanks.

  • Help with displaying BLOBs in OBIEE 11g

    I am trying to get OBIEE 11g to display photographs in an Analysis report. I know BLOB fields are not supported, and I have been reading posts on this board and following examples on internet sites that try to get round this problem. But, try as I might, I cannot get those pesky photos to display.
    Below are all the steps I have followed. Sorry that there is a lot to read, but I was hoping that somebody has been successful in doing this, and may spot something in one of my steps that I am doing wrong.
    ORACLE TRANSACTIONAL SOURCE_
    Table : EMPL_PHOTO
    Fields:
    USN VARCHAR2(11) ( Unique Key )
    EMPLOYEE_PHOTO BLOB ( I think the photos are stored as 'png' )
    ORACLE WAREHOUSE SOURCE_
    Table : D_PERSON_PHOTO_LKUP
    Fields :
    PERSON_KEY     NUMBER(38,0) ( Primary Key - Surrogate )
    USN     VARCHAR2(11)
    PHOTO     CLOB
    BLOB to CLOB conversion.
    I used this function :
         create or replace function blob_to_clob_base64(p_data in blob)
         return clob
         is
         l_bufsize integer := 16386;
         l_buffer raw(16386);
         l_offset integer default 1;
         l_result clob;
         begin
         dbms_lob.createtemporary(l_result, false, dbms_lob.call);
         loop
         begin
         dbms_lob.read(p_data, l_bufsize, l_offset, l_buffer);
         exception
         when no_data_found then
         exit;
         end;
         l_offset := l_offset + l_bufsize;
         dbms_lob.append(l_result, to_clob(utl_raw.cast_to_varchar2(utl_encode.base64_encode(l_buffer))));
         end loop;
         return l_result;
         end;
         select usn, employee_photo ,
         BLOB_TO_CLOB_BASE64(employee_photo)
         from empl_photo
    IN OBIEE ADMINISTRATION TOOL_
    *1) Physical Layer*
    Added D_PERSON_PHOTO_LKUP from Connection Pool
    Left it as 'Cachable'
    Didn't join it to any tables
    Changed field PHOTO to a 'LONGVARCHAR' length 100000
    Set USN as the Key ( not the surrogate key )
    *2) BMM Layer*
    Dragged D_PERSON_PHOTO_LKUP across.
    Renamed it to 'LkUp - Photo'
    Ticked the 'lookup table' box
    Removed the surrogate key
    Kept USN as the Primary key
    The icon shows it similar to a Fact table, with a yellow key and green arrow.
    On Dimension table D_PERSON_DETAILS (Dim - P01 - Person Details) added a new logical column
    Called it 'Photo'
    Changed the column source to be derived from an expression.
    Set the expression to be :
    Lookup(DENSE
    "People"."LkUp - Photo"."PHOTO",
    "People"."Dim - P01 - Person Details"."USN" )
    Icon now shows an 'fx' against it.
    Note: This table also had it Surrogate key removed, and USN setting as primary key.
    *3) Presentation Layer*
    Dragged the new Photo field across.
    Saved Repository file, uploaded, and restarted server.
    ONLINE OBIEE_
    Created a new Analysis.
    Selected USN from 'Person Details'
    Selected Photo from 'Person Details'
    Selected a measure from the Fact table
    Under column properties of Photo ( data format ) :
    - Ticked 'Override Default Data Format' box
    - Set to Image URL
    - Custom text format changed to : @[html]"<img alt="" src=""@H"">"
    Under column properties of Photo ( edit formula ) :
    - Changed to : 'data:image/png;base64,'||"Person Details"."Photo"
    The Advanced tab shows the sql as :
         SELECT
         0 s_0,
         "People"."Person Details"."USN" s_1,
         'data:image/png;base64,'||"People"."Person Details"."Photo" s_2,
         "People"."MEASURE"."Count" s_3
         FROM "People"
         ORDER BY 1, 2 ASC NULLS LAST, 3 ASC NULLS LAST
         FETCH FIRST 65001 ROWS ONLY
    Going into the 'results' tab, get error message:
    +State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 17001] Oracle Error code: 932, message: ORA-00932: inconsistent datatypes: expected - got CLOB at OCI call OCIStmtExecute. [nQSError: 17010] SQL statement preparation failed. (HY000)+
    It doesn't seem to be using the Lookup table, but can't work out at which step I have gone wrong.
    Any help would be appreciated.
    Thanks

    Thanks, yes I followed http://docs.oracle.com/cd/E28280_01/bi.1111/e10540/busmodlayer.htm#BGBDBDHI, but when I get to the part of setting the LOOKUP function on th Physical source, only ONE physical source is displayed. I need TWO sources ( The Employee Table, and the Photo LookUp.
    I have raised this as an error with Oracle. We are now on OBIEE 11.1.1.7, but Oracle say BLOBS are still not supported in that release. It will be fixed in 11.1.1.8 and it will be backported into 11.1.1.6.11
    In the meantime we have abandoned showing Photo's in any of our reports.

  • Display BLOB objects (doc, pdf, jpg, etc) in Browser

    Hello.
    I need help retrieving BLOBs from my DB and displaying them on a browser using Java (or JSP). The BLOB can contain any types of file form (such as pdf, doc, xls, jpeg,etc).
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by LP:
    Hello.
    I need help retrieving BLOBs from my DB and displaying them on a browser using Java (or JSP). The BLOB can contain any types of file form (such as pdf, doc, xls, jpeg,etc).
    <HR></BLOCKQUOTE>
    null

Maybe you are looking for

  • I can't get my headset mic to work when using team speak anyone help ?

    hi i am playing WOW in my windows partition, but cant get the mic to work in a program called teamspeak i know i works ok as it's ok on my dell laptop, i can hear ok. it's not just in that game , i have tried to record, but it keeps telling me mic no

  • Problems with a WRT54G wireless linksys router.

    Hello, I'm having problems with my WRT54G linksys wireless router. With this router, I tend to get lag spikes and often disconnect while playing online games at a certain time. The spikes usually get worse during the afternoon/evenings (2pm-12am PST)

  • Sms failure

    Skype SMS is a SCAM, most messages never reach, I have been billed for three messages over the past week, which I sent to terst he service., Not one of them was delivered. It is a scandal which needs investigation. It is nothing to do with the cost b

  • FValueGet Function in FDMEE

    Dear all, In FDM Classic I could use the fValueGet function to retrieve data from HFM. Is there a similar API existing in FDMEE if I want to create a mapping based on a pre-load data value in my HFM target application? Thanks a lot in advance, Christ

  • Find new width and height of a rotated item

    hi all, I have an issue where I have a rectangle that I rotate and I need to know the new width and height of the bounding box of the rectangle when it has been rotated example: I have this rectangle shape so its known width and height is 20pixels x