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