Hire me on UpWork

Tuesday, February 7, 2012

How to Read Image File at Oracle Forms 10g ?

I heard and answered lot's of question. How i read image file from file system to Database in oracle forms 10g ?
Here is the solution.
First of all you have to configure webutil correctly. You need to configure formsweb.cfg, webutil.cfg
Attach the webutil.pll library at your forms. Make object group and subclass of webutil.pll
Now add a puss button to your form and write the following code at When-Button-Pressed trigger
--------------------------------------------
declare
 vfilename varchar2(300);
begin
 vfilename := client_get_file_name(file_filter => 'jpg(*.jpg,*.gif)|*.*');
 if vfilename is not null then
 client_image.read_image_file(vfilename,substr( vfilename,instr( vfilename, -1)),'COMPANY_INFO_MST.CIM_LOGO');
 client_image.write_image_file(vfilename,'','COMPANY_INFO_MST.CIM_LOGO'); 
 end if;
 
end;
-----------------------------------
set the following property of the image item.
image format: TIFF
sizing style: Adjust
 
You are done...  

11 comments:

  1. Help please, retrieve Oracle image

    hello!
    I'm from mexico and my English is not so good an apology for spelling errors.

    could please help me to recover an image, I'm working with Oracle Forms 10 g.

    the problem is this:
    Through a WebService send an image as a String and retrieve it in Forms as VARCHAR2, how I can tranform it to image.jpg? so I can print on a ITEM Image

    For your attention, thank you very much!

    My email is: razape12@yahoo.com

    ReplyDelete
  2. Hi I'm Nazia from Bangladesh. I want to read image file to a control block and assign it a control Item. How can I do that. Image save a database table Now I want to retrieve It another table. How can it possible tell me...

    ReplyDelete
  3. @ Nazia,
    As'salamualikum
    It depends on your form version. May i know your forms version ? Image filed data type at database ?

    Hamid Helal

    ReplyDelete
  4. Hi,
    Read_image_file is not working if the image size is more then 400kb
    if it's less then it's working
    kindly give me the solution. i am using oracle form 10g

    ReplyDelete
  5. HI,
    Asalam U alikum
    I use Orcale 10g Beacuse read_image_file is not work.
    Please any body help me how to set image in Oracle 10g..

    ReplyDelete
  6. use webutil function to do this

    ReplyDelete
  7. Hi i have written the related code but i am getting the error in client_get_file_name

    ReplyDelete
  8. Hello

    if anyone want to display image in the forms use the the below method

    :global.forms_path:='D:\images\'; ---give a path here
    read_image_file(:global.forms_path||'flower.tiff','tiff','image4'); --give image name as flower and container name as image4 and image format should be tiff

    ReplyDelete
  9. can you please share the sample form.

    ReplyDelete
    Replies
    1. What exact issue you are facing ? @Hasan_jawaid

      Delete
  10. Hi, we want to read large images/images with more number of bytes in PDF in 12c reports, previously we were using ORDSYS to get height and width, now it is not there in 19c

    ReplyDelete