Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trap for missing JPG file when read from file

Status
Not open for further replies.

bookouri

IS-IT--Management
Feb 23, 2000
1,464
US
I have a report that displays images that are "read from file" from jpg files. i.e I have a select something like:
select 'd:\images\'||emp_id||'.jpg' my_photo, Then I do "read from file" in the report and the correct .jpg file is retrieved. The problem occurs when the report hits a record that does not have a jpg file. The report crashes at that point and will not continue. How can I trap this error so the report can continue? All records have a valid emp_id so I cant do an nvl(emp_id,99999). Since all records have a valid emp_id I also cant use the report property for null value, the value is never null, the physical JPG file may not exist, but the emp_id always exists.

any suggestions would be appreciated..
 
After researching this one, I found that you have to do something like:

"Best way to achieve this would be to create a formula column that returns a filename, checking on 'read from file' and 'image type' in the data model, and in the formula, ensuring the existance of the file thru text_io.fopen which will raise an exception if the file does not exist, in which case you can then display some sort of "file nonexistant" image."

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top