11.01.2013 Views

Oracle Forms Developer – Form Builder Reference, Volume 1

Oracle Forms Developer – Form Builder Reference, Volume 1

Oracle Forms Developer – Form Builder Reference, Volume 1

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

332<br />

BEGIN<br />

/*<br />

** Set the message level high so we can gracefully handle<br />

** an error reading the file if it occurs<br />

*/<br />

:System.Message_Level := ’25’;<br />

/*<br />

** After fetching an employee record, take the employee’s<br />

** Userid and concatenate the ’.TIF’ extension to derive<br />

** the filename from which to load the TIFF image. The EMP<br />

** record has a non-database image item named ’EMP_PHOTO’<br />

** into which we read the image.<br />

*/<br />

photo_filename := tiff_image_dir||LOWER(:emp.userid)||’.tif’;<br />

/*<br />

** For example ’photo_filename’ might look like:<br />

**<br />

** /usr/staff/photos/jgetty.tif<br />

** ------<br />

**<br />

** Now, read in the appropriate image.<br />

*/<br />

READ_IMAGE_FILE(photo_filename, ’TIFF’, ’emp.emp_photo’);<br />

IF NOT FORM_SUCCESS THEN<br />

MESSAGE(’This employee does not have a photo on file.’);<br />

END IF;<br />

:SYSTEM.MESSAGE_LEVEL := ’0’;<br />

END;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!