reading image in oracle form

hi
i have oracle form
text item << s_item
when i type item code , it show me some information of the item
i added image item to the form to display image of the item
i put the images "jpg" format under one folder  "item_photo"
but not all items has image
i want to display image item when i type item code in s_item
to avoid item not found
i created this function as i found
CREATE OR REPLACE FUNCTION file_exists(p_fname IN VARCHAR2) RETURN BOOLEAN
AS
  l_file UTL_FILE.FILE_TYPE;
BEGIN
  l_file := UTL_FILE.FOPEN(SUBSTR( p_fname, 1, instr(p_fname,'/',-1) ),
                           SUBSTR( p_fname, instr( p_fname, '/', -1)+1 ), 'r' );   
  UTL_FILE.FCLOSE( l_file );
  RETURN TRUE;
EXCEPTION
  WHEN UTL_FILE.INVALID_PATH      THEN RETURN FALSE;
  WHEN UTL_FILE.INVALID_OPERATION THEN RETURN FALSE;
END;

Open in new window


then when validate item of s_item i added this code
IF ( file_exists( 'j:\Item_Photo\71030126.jpeg' ) ) then
	READ_IMAGE_FILE('j:\Item_Photo\71030126.jpeg','jpeg','genral.im_item');
end if

Open in new window


but image not found as per the message
(the image is exist in the image folder)
i tried also to change from jpeg to jpg
but same error
NiceMan331Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

slightwv (䄆 Netminder) Commented:
Not sure if this is problem still exists in your Forms version but there appears to be different types of JPEG and what Forms supports:
https://community.oracle.com/thread/36256
0
NiceMan331Author Commented:
so , you mean i have to convert the photos to JFIF ?
0
slightwv (䄆 Netminder) Commented:
I'm really not saying anything.  Just pointing out that older versions of Forms would not handle all types of JPEG images.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

NiceMan331Author Commented:
I'm using forms 6i , what is your advice now ?
0
slightwv (䄆 Netminder) Commented:
Take one of the images you know are on the disk that don't show up in the form, convert it to JFIF and see if it will load.  If so, you have your answer.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
NiceMan331Author Commented:
Great , now I have to create new topic in different area about how to convert to jfif
0
NiceMan331Author Commented:
yes ok slightwv
the image being loaded to the form
remaining 2 things
1- the function of file_exist not works here , it always gives false even the file exists
i want to solve issue if file not exits
2-i have only small space in the form for the image , but the images becomes not in full size , how to adjust
to display the whole image
0
slightwv (䄆 Netminder) Commented:
1:  Comment out the exception handler and see which exception is being generated.  Then we can go from there.

Since you are using the actual OS path, I'm guessing you have set up UTL_FILE_DIR in the init file.  Can you post the values for it?


2:  I'm not a forms person so I cannot say how to make the image display as a thumbnail.
0
NiceMan331Author Commented:
ok , please give me a chance till Saturday to try it
because now the office closed
thanx
0
NiceMan331Author Commented:
1:  Comment out the exception handler and see which exception is being generated.  Then we can go from there.

it gives this exception
WHEN UTL_FILE.INVALID_PATH      THEN RETURN FALSE;

Since you are using the actual OS path, I'm guessing you have set up UTL_FILE_DIR in the init file.  Can you post the values for it?
i didn't understand which value i have to post ?
0
slightwv (䄆 Netminder) Commented:
UTL_FILE_DIR is a spfile/fpile paramter:
http://docs.oracle.com/cd/E11882_01/server.112/e40402/initparams270.htm#REFRN10230

If you use a path not an Oracle directory, you must had the path set in UTL_FILE_DIR.  Changing this requires bouncing the database.

Your DBA should be able to help you with this.
0
NiceMan331Author Commented:
ok , in here i have to close this question and open another 2 for my other 2 requirement
the file path & the image size
thanx
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.