Reference images outside the database

Hi,
I tried to return html content from a pl/sql procedure but the images referenced were missing. Attached please see the part of the coding in the pl/sql procedure. Everything worked except the images. When I specified something like <img src="" />, the image would come up. Whenever I included an inline (or external) stylesheet in the pl/sql procedure, the images were not picked up.
Thanks.
Andy
Here is the code:
CREATE OR REPLACE PROCEDURE test_email AS
ret_code integer := -1;
begin
-- Send email
select db_mail.send_mail('[email protected]',
'test email',
'<html>
<head>
<title></title>
<style type="text/css">
div#pullquote
     background: #fff url(<reference image in another server>) no-repeat;
div#pullquote p
     padding: 0 20px;     
div#pullquote h2
margin: 0;
     padding: 20px 20px 0 20px;
     background: url(<reference image in another server>) no-repeat 100% 0;
div#pullquote p.furtherinfo
     text-align: right;
</style>
</head>
<body>
<!-- start content -->
<img src="http://<server name>:7778/i/themes/custom/hrims_logo.gif" alt="" class="left" />
     <div id="pullquote">
<h2></h2>
     <h3>this is a test</h3>
</div>
<!-- end content -->
</body></html>',
'HRiMS',
'text/html')
INTO ret_code
FROM dual;
end test_email;

CREATE OR REPLACE PROCEDURE test_email AS
  ret_code integer := -1;
begin
  -- Send email
  select db_mail.send_mail('[email protected]',
           'test email',
           '<html>
           <head>
           <title></title>
           <style type="text/css">
div#pullquote { background: #fff url(<reference image in another server>) no-repeat; }
div#pullquote p { padding: 0 20px; }
div#pullquote h2 { margin: 0; padding: 20px 20px 0 20px; background: url(<reference image in another server>) no-repeat 100% 0; }
div#pullquote p.furtherinfo { text-align: right; }
           </style>
           </head>
           <body>
           <!-- start email content --><div id="pullquote"><h2></h2>this is a test</div>
           <!-- end content -->
           </body></html>',
           'HRiMS',
           'text/html') INTO ret_code FROM dual; end test_email;The database version is 10.2.0.1.0.
I'm trying to use PL/SQL to generate email content in HTML.
Thanks.
Andy

Similar Messages

  • Can Discoverer have link to display documents stored outside the database?

    I posted a message some time ago called "Possible for Discoverer to display BLOB type documents stored in database?" and got great answer.
    Now our customers are asking if it is possible, from Discoverer, to link somehow to a file stored outside the database on the Unix file system and get their computer to display it? Can anyone tell me if this is possible please?
    The only thing I've seen in the documentation that may be related is in Oracle Business Intelligence Discoverer Configuration Guide, section 10.6 List of Discoverer user preferences. It says there that Discoverer preference ProtocolList can be set so that Discoverer hyperlinks can be set to use protocols such as telnet, but the default is HTTP, HTTPS, and FTP.
    THank you in advance if you can help.
    Regards,
    Julie.

    Hi Rod,
    I have tried the second method: "create a Oracle directory pointing to the Unix directory containing the files". I have had success with it, but I'd be grateful if you could advise me if you would have done this the same way as described below:
    I put two Word docs and two text docs called clob_test1.txt, clob_test2.txt, blob_test1.doc, blob_test2 in the Unix directory corresponding to an Oracle directory called 'EIF'. I thought an extrenal table was needed so that Discoverer would have an object to write a queruy against. So I created a file called lob_test_data.txt with the following contents:
    1,01-JAN-2006,text/plain,clob_test1.txt
    2,02-JAN-2006,text/plain,clob_test2.txt
    3,01-JAN-2006,application/msword,blob_test1.doc
    4,02-JAN-2006,application/msword,blob_test2.
    THen I created an external table using the following DDL:
    CREATE TABLE jum_temp_lob_tab (
    file_id NUMBER(10),
    date_content DATE,
    mime_type VARCHAR2(100),
    blob_content BLOB
    ORGANIZATION EXTERNAL
    TYPE ORACLE_LOADER
    DEFAULT DIRECTORY EIF
    ACCESS PARAMETERS
    RECORDS DELIMITED BY NEWLINE
    BADFILE EIF:'lob_tab_%a_%p.bad'
    LOGFILE EIF:'lob_tab_%a_%p.log'
    FIELDS TERMINATED BY ','
    MISSING FIELD VALUES ARE NULL
    file_id CHAR(10),
    date_content CHAR(11) DATE_FORMAT DATE MASK "DD-MON-YYYY",
    mime_type CHAR(100),
    blob_filename CHAR(100)
    COLUMN TRANSFORMS (blob_content FROM LOBFILE (blob_filename) FROM (EIF) BLOB)
    LOCATION ('lob_test_data.txt')
    PARALLEL 2
    REJECT LIMIT UNLIMITED
    then created a Discoverer End User Layer folder against this external table, and used exactly the same technique as we did for downloading the BLOB from the database table (creating a new folder item containing a URL calling a database procedure which calls the Oracle code to download the doc). THis worked, but sometimes my PC didn't seem to know that the Word docs were Word docs and it needed to launch Word. Other times it did manage to do this OK. It always displayed the two .txt files as HTML docs.
    Just wondered if you'd be good enough to critique this approach.
    THank you, Julie.

  • Is it better to store the image in the database or to use BFile

    Hi all,
    I've a doubt regarding the handling of the image. For example i've the images of the persons amounting to 50,000(the number will be increased in future). So i just want to know which is the better menthod. is it better to store all the images in the database or to store in local OS and use Bfile concept. I'm using Forms 6i and Forms 10g(10.1.2.0.2). OS: Windows XP
    Regards,
    Alok Dubey
    Edited by: Alok Dubey on Nov 14, 2008 5:43 PM

    But the total number (i.e.., 50,000) is scaring me to use the BlobI don't think the database will cause problem just due to the amount of data stored in blobs. Of coure you would have to check which parameters to set for the blobs to make storage efficient. If
    You didn't mention your db-version, in 11G you could also think of using compression and deduplication to deal with the data amount.
    In general i agree with Francois, the best way depends, but in terms of data consistency and easy backup/restore there might be some advantages in using the blob-version.
    hope this helps.

  • How do i store and fetch image from the Database(Access)

    i am facing one problem in inserting the image into the database.the steps i followed as
    1)i have created one database(access) as "Image" and into that one table as "Image" and field as "image"
    type of the field is ole object.
    2)i have inserted one image into the image field through "database.vi"
    3)now i am trying to get the image from the database by "Fetching Example.vi"
    4)it will succesfully retrieve the image from that field .
    5)but when i close the both programs and reopen those that time i am unable to get retrieve the image.
    Attachments:
    Add_to_Database.vi ‏78 KB
    Fetch_from_database.vi ‏67 KB

    I would like to suggest different approach for saving the images in the database.
    I was working on Medical Imaging Company. The way we save the images in real-time was by writing the name and path of the images to database.
    The images themselves where saved directly to disk.
    I don�t think that access is very good in taking care of GBytes of data.
    It happens some time that the database gets damage. If you have the images separately you can create fix procedure. (We had one).
    Good Lack,
    Amit Shachaf,

  • Problems while accessing images outside the web document-root folder

    Our application runs on Oracle application server on Linux. Facing problems while accessing images outside the web document-root folder. This works with changes in global-web-application.xml by including the <virtual-directory> tag. The same change does not work when done on Linux machine. It is unable to find the image. Please help in resolving this issue.
    </locale-encoding-mapping>
    </locale-encoding-mapping-list>
    </web-app>
    <virtual-directory virtual-path="/img" real-path="/home/eposuat/" />
    </orion-web-app>
    Code in the jsp:
    <img width=700 height=700 src="/img/3.tif"></img>
    <img width=700 height=700 src="/img/WB.gif"></img>

    This is one of the least satisfactory aspects of site management in Dreamweaver, and several developers, including myself, have been pressuring the Dreamweaver team for some years to improve this. Who knows? They might eventually take notice.
    The only way to do this at the moment is to create two site definitions, one nested inside the other. Set up the site definition normally based on htdocs as your site root. Then create a new site definition based on site. Dreamweaver will nag you that it can cause problems, but it won't actually stop you from doing it. The only potential problem is with site synchronization.
    The problem with using site as the only basis for your site definition is that Dreamweaver automatically puts things like the Connections, Scripts, and other folders in the site root. So, everything ends up at the wrong level of the site hierarchy. Quite frankly, the whole thing is a bit of a pain. Dynamic site development was added to Dreamweaver only in version 6 (Dreamweaver MX), and no one had really thought through the need to store files outside the site root.

  • Storing images inside the database

    hi,
    we are running oracle 9ir2 on Solaris and would like to know how to go about achiving the following:
    would like to be able to read/write/create/delete bitmap image files in a file share on the same server as the database which would be stored in a table within our schema in the form <filename varchar2>,<image-file-contents blob>
    Is this possible?! If so - any pointers in the right direction would be great!
    thanks,
    p

    To some extent, this was covered a few days ago in the PL/SQL forum. There are some examples of uploading image files to blobs in the database here.
    upload any file (like .DOC,.JDG) to oracle database?
    If you want the images to be visible on a file system, you may want to use BFILE's, rather than BLOB's. BFILE's are essentially pointers in the database to file system objects, while BLOB's are stored completely in the database. The major disadvantages of BFILE's are that
    - the file may be deleted or moved, leaving the Oracle BFILE pointing at nothing
    - the file won't be backed up with the rest of the database
    Going up a level of sophistication, you could store the images using interMedia. This gives you significantly more options for manipulating the images within the database.
    Finally, you can use Oracle iFS (or whatever it's been renamed to today) to provide a file system interface to an Oracle database. This is the most robust of the options, but is also the most work to configure.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Can BI Publisher read the images from the Database?

    Hi All,
    Can BI Publisher read the images from the Database?
    if yes how it can be achieved?
    Thanks
    Aravind

    Hi,
    There is an example in oracle db. Use the schema PM (Print Media).
    Select the corresponding table that contains the column AD_PHOTO.
    In your RTF template simply to print the image stored in the db use:
    <fo:instream-foreign-object content-type="image/jpg"> <xsl:value-of select="AD_PHOTO"/>
    </fo:instream-foreign-object>
    RUn the RTF template and it should show you all.
    Cheers
    Jorge
    p.s. If this answers your question then please grant the points and close the thread

  • Loading an Image from the database and display it on browser

    I do not know if this is even possible.
    At the moment, to load an image inside an Html page you need to use the <img src=""> tag. and in the src you put the path of the image. Now I would like to save an image inside the database.
    An option to still display the image on the browser would be that my service object, would load the object from the database (saved as blob) then save it somewhere on the Server, and the still use the <img> tag to load the image from that location.
    However I was wondering wheather there is another way to do it without saving this image on the server. that is loading the bytes from the database (or a location on the server) and provided these bytes to the jsp page to display the image.
    Is this possible? or?
    regards,
    sim085

    hmm ... ok .. that sounds good .. but that means that
    a servlet must exsist at all time to display the
    required image.Servlets are usually instantiated by the servlet container upon an incoming request.

  • Display Image from the database but prevent it from refreshing on every pages

    Hi there,
    I can see there are many discussions around this but my query is slightly different. I'm writing this on behalf of one of my developers. (sorry for my ignorance on techie stuff.. :-))
    A logo is being displayed on a few pages, which is called from the database. However, the problem is that  - this logo refreshes every time when you traverse to each page causing a performance issue or sometimes slow loading of the image.
    My question is - how do we stop it from loading on each page from the database?.  I would rather load once when the main page loads initially and then maintain this on other pages too.
    We can keep this logo on a file system (FS)  and display it via CSS/HTML/frame but since we want to keep it flexible/dynamic where a user can upload a new one whenever it changes and hence DB seems to be the suitable option (in my opinion).
    Can someone please help?
    If you need any further info around the coding how it is being done at present, pls let me know.
    Thank you

    read this http://docs.oracle.com/cd/B28359_01/appdev.111/b28393/adlob_tables.htm#g1017777
    you can cache lobs in the database too
    you can also upload the pic in your file system using utl_file package and then put the image in the working directory mentioned in i.war
    you can then reference the image and it will not be stored in the database and will be cached
    Regards,
    Vishal
    Oracle APEX 4.2 Reporting | Packt Publishing
    Vishal's blog

  • Loading an Image to the Database

    Hello
    I have a requirement to load 1000's of images to a database.
    In the pass we have successfully loaded images from a screen using
    select blob_content, id into image, apex_id from apex_application_files where name = :P120_LOAD for update;
    I now tried to use apex_application_file to do the same in a background PL/SQL procedure
    COMPANY_ID_FILE:= 'E:\' || COMAPANY_ID || '.jpg';
    select blob_content, id into image, apex_id from apex_application_files where name = COMPANY_ID_FILE for update;
    This does not seam to work!?
    I believe apex_application_files is not the right function to used in this case
    Any comments or recommendation very welcome
    Thanks
    Pete

    Hello
    I pleased to report it is all working now.
    My thanks to the people above, Harm ten Hapel from Oracle support and the link below
    http://www.psoug.org/reference/dbms_lob.html
    This is what I did:
    Created a directory within Oracle which linked the directory on the Oracle server. It does not create a directory on the server. This need to done manually.
    create directory data as 'c:\data';
    To show that you created the directory correctly
    select directory_path from all_directories;
    To delete a directory
    drop directory data;
    The code I used is
    begin
    TEMP:= data ||'.jpg'; -- file name on the server
    dbms_lob.createtemporary(l_blob,true); -- initialise the Blob field
    l_bfile := BFILENAME('HOTEL',TEMP); -- Assigns file
    DBMS_LOB.fileopen (l_bfile, DBMS_LOB.file_readonly); -- open file
    lgh_file := dbms_lob.getlength(l_bfile); -- collects file length
    dbms_lob.loadfromfile(l_blob, l_bfile, lgh_file); -- reads file
    DBMS_LOB.fileclose (l_bfile); -- closes file
    --- Extracts the information about the blob data
    DBMS_LOB.CREATETEMPORARY(attributes, TRUE, DBMS_LOB.CALL);
    ORDSYS.ORDImage.getProperties(l_blob,
    attributes,
    img_mimeType,
    img_width,
    img_height,
    fileFormat,
    compressionFormat,
    contentFormat,
    img_contentLength);
    image:= l_blob;
    RECORD_FOUND:= 0;
    --- This is important as the system will only let you open a small number of file at open. If the file open fails it still counts as an open file and find the load programming failing with too many file open error
    EXCEPTION
    WHEN OTHERS THEN -- catches all 'no data found' errors
    DBMS_OUTPUT.PUT_LINE('DATA_FOUND - file = ' || TEMP);
    DBMS_LOB.fileclose (l_bfile);
    record_found:= 1;
    end;
    I hope it is of help
    Thanks to all
    Pete

  • Uploading of image to the database?

    Hi all, how do we bring up a File browser window on oracle form and upload a pic to the database?
    Can someone show me how they will create a simple db to store image, and the file browser window method?

    Here are a couple of links to information on storing files in an Oracle database. Hope they help.
    How to: Read and Write BLOB data to a Database Table...
    Storing pictures and photos in Oracle tables
    Craig...

  • Please help to load image in the database

    Hi to all. ....
    I need to save image file in the database thru forms ...
    I have some image file in the application server and I need to load it in the database in a Blob col..
    Any help ... ??
    Thank's in advance

    Hi!
    Your forms version is very important.
    If you use forms 10g and you want to load the image on the client, you need webutil.
    If you use forms 6 or you want to load the image from the application server to
    a image item in your form, you can use the read_image_file forms build-in:
    read_image_file ( 'x:\path\image.jpg.', 'JPG', 'block.image_item' );On forms 10g this will be executed on the server and the filename and path has to be
    a physical place on your servers harddisk.
    The image item has to be an item of type image and must be assinged to a blob colum in your table.
    Regards

  • How to upload files/images to the database from a form.

    I'm making a custom user profile form.
    The users can update their profile in this form.
    I cannot use the standard profile form, because the customer got very specific
    demands about the context of the profile form.
    In this custom profile form the user must be able to upload an image
    from their hard disk(just like in the standard profile form).
    I've got the following questions about uploading pictures:
    - How do I make a button to show the explorer window.
    - how do I get the chooses file-name in a field.
    - how do I get the new file in the database.
    - how do I get rid of an old file in the database.
    - how do I get the image on the form.
    Or is there a special portal way to upload images/files in a form.
    Does anyone have a clue?
    regards
    arny

    Hi,
    Regular Portal forms will support upload of images/documents to the database. Just identify your column as a blob, and the 'Browse' button will automatically show up in the form and the users will get to choose the file they want to upload from their desktop.
    The thing is, I haven't been able to figure out how to get that document/image back out of the database (e.g. in a report), once it's put in. Maybe someone else can answer that.

  • Loading Image outside the jar

    I have a .jar program that saves and loads imagens from a folder outside the jar. In my directory I have:
    myProg.jar
    images(folder)
    This is the way myProg.jar saves the images:
    BufferedImage myImage; //myImage is initialized somewhere else
    File file = new File("images/Pic"+temp+".jpg");
        try{
        ImageIO.write(myImage, "jpg", file);
           }catch(IOException io){}
    }catch(AWTException ea){}When I check the image is saved in my folder "images"
    Then, the prog tries to load the images this way:
    URL url = getClass().getResource("/images/"+name+".jpg");
    ImageIcon icon;
             if (url != null) {
                  icon = new ImageIcon(url);
                  picture.setIcon(icon);
             else {
                  url = getClass().getResource("/images/street.jpg");
                  icon = new ImageIcon(url);
                  picture.setIcon(icon);
             }Here I have an exception : Exception in thread "AWT-EventQueued-0" java.lang.NullPointerException
    I checked the url and it�s ok.
    Hope someone help.

    Well, I modified the getJarPath method to this:
    String getJarPath1(){
              String path=System.getProperty("java.class.path");
              for(int i=0;i<=path.length()-1;i++)
                   if(path.charAt(i)==';'){
                        return path.substring(0,i);
              return "";
         }Now I got the path I really need, for example:
    C:\Program Files\Eclipse\Workspace\myProject\images\pic.jpg
    Though, the picture is not loading. Here is what I am doing:
    String path=getJarPath1()+"\\images\\" + name + ".jpg";
    //path=C:\Program Files\Eclipse\Workspace\myProject\images\pic.jpg -> correct path
    URL u=null;
    try{
                 u = new URL(path);   //u is always null! why?
                }catch(MalformedURLException mf){}
    if(u!=null)
             try{
             icon = new ImageIcon(u);
             picture.setIcon(icon);
             }catch(Exception bla){}
             else {
             }What�s happening is that my "path" got the correct path, but when I put it in the URL it�s becoming null.
    The picture and the folder are in the correct place.
    I hope someone helps. Thx!

  • Oracle apex outside the database

    What risks or impacts do you think if I plan to implement APEX outside the production database. Basically having a separate database all together and apex running into that seperate database. But a lot of source data is in the production database. So looking into this situation, what are the risks and concerns you might think of?
    My team is not comfortable implementing apex inside the production database.

    Hi
    >
    they never install anything on production databases, apex installs a lot of its own objects and they want to keep production bare bones.
    >
    I can see no real justoification to back this up. Ideally APEX should be running within the database where the data that it is accessing it resides. The objects that APEX creates are contained within its own schema and it doesn't take up much space at all.
    By separating the APEX install to a different database, you create a whole new level of configuration headaches and things to go wrong.
    >
    my concern is about vendor level support and other issues
    >
    APEX is free as long as the database is sufficiently licensed - you don't need anything additional to have APEX running on a correctly licensed Oracle database.
    It appears that 'they' have decided on a blanket rule through fear of breaking something (probably due to something having gone wrong once in the past). This is not the correct way to work. If they took the time to understand the technology that they are administering, they would see that an APEX installation should have pretty much zero impact on the production database.
    We successfully run 3 APEX instances on the three production systems, each where the relevant data resides - 2 OLTP databases and a Data Warehouse.
    Again, if they can come up with something specific rather than a sweeping statement and a suggestion to do it another way (using db links) with no reasoning or justification - it would be easier to allay their fears.
    Cheers
    Ben

Maybe you are looking for

  • CS5 editing mode not supported and file import error

    Hi.  I edited a series of projects on PP CS5 on my iMac.  My computer crashed, so I am now working off my MacBookPro to finish off a few projects.  I have PP CS5, Final Cut Pro, and Quicktime all installed.  I have also downloaded all the ProAppsQTco

  • Message Driven Bean debugging not supported in 9.0.3?

    Message Driven Beans are now supported with the preview of 9.0.3, but you can't debug into them using the embedded container? Will this be resolved for the release version?

  • Error in physical inventory

    hi gurus When creating cycle count at plant level,  location error occur, for a material The error message is coming as given below <b>No batches that can be includedin physical inventory exist for 'XXXXXXX" (material)</b> kindly suggest what could b

  • Safari crashes on adobe flash player sites

    Hello! My family plays on the very popular Webkinz website, but for the past week and a half, Safari keeps randomly crashing while accessing the site. Not sure if it is a site issue or a browser issue. I do have the current updates for Leopard, and I

  • OCM RAC Physical dataguard setup

    Hi I am preparing for the OCM examination and have gone through the detailed course outline but i am not clear on the following things. OCM exam topic is very broad and the course outline does not cover topics in detail. Suppose the examiner asks me