Oracle Forms 6i - Image Browse and Save and Show Image in Report

 In Oracle Developer Forms 6i, We can easily browse and save Images in the database.

Step 1:

At first create a table with the following script:

CREATE TABLE IMAGE
(
ID                 NUMBER(10),
IMAGE          LONG RAW
);

Step 2 :

Now create a form using a wizard :

Write the following code in the BROWSE button using WHEN-BUTTON-PRESSED trigger:

DECLARE
filename VARCHAR2(256);
BEGIN 
filename := GET_FILE_NAME(File_Filter=> 'Jpg Files (*.jpg)|*.jpg|');
READ_IMAGE_FILE(filename, 'Jpg', 'IMAGE.IMAGE');
END; 

Step 3:

Write the following code in the SAVE button using WHEN-BUTTON-PRESSED trigger:

IF :IMAGE.ID IS NULL THEN
  SELECT NVL(MAX(ID),1000)+1 INTO :IMAGE.ID FROM IMAGE;
END IF;
COMMIT_FORM();

Step 4:

Now Browse jpg picture and press SAVE.

In the Report create a report with the following query;

Select * from image;

Change the Image Property file format to : Image
Sizing Property to : Adjust

Step 5: 
Run the Report :



Enjoy !!!

Sample Download Link :

https://drive.google.com/file/d/1XuiL_m23JaQSoe1178tokenIVw8AReiy/view?usp=sharing

Muhammad Abdullah Al Noor

Muhammad Abdullah Al Noor, An Oracle Apex Consultants and founder of Noors Technology (www.noorstech.com). Core Expertise : Database Administration, Oracle Forms and Reports Development, Oracle Apex Application Designer and Development, Linux Professional etc. Also the owner of TrainerBD Training and OraDemy E-Learning. WhatsApp +8801790721177

Post a Comment

Previous Post Next Post