Articles Oracle Forms, PL/SQL, Java, J2EE
I was asked to build a JSP page within our Portal application to show some employee's characteristics.
It is easy to get all the common attributes with the search() method, but I never found anything to get the photo. Maybe this kind of function exists but I never found it.
So I decided to search where this binary file was stored.
Actually, it is stored in the ODS.DS_BATTRSTORE table:
| CREATE TABLE DS_BATTRSTORE ( ENTRYID NUMBER NOT NULL, ATTRNAME VARCHAR2(255 BYTE) NULL, ATTRVAL BLOB NULL, ATTRHASHVAL VARCHAR2(4000 BYTE) NULL ) |
The ENTRYID contains the internal number, the ATTRNAME contains in this case the constant ‘jpegphoto’ and the image is stored in the ATTRVAL column.
So, if you know the employee number, you can extract his/her photo with the following query:
SELECT
attrval
FROM
DS_BATTRSTORE bs
WHERE
bs.attrname = 'jpegphoto'
AND EXISTS
(
SELECT 'x' FROM CT_EMPLOYEENUMBER ct
WHERE ct.entryid = bs.entryid AND ct.attrvalue = 'employee_number'
)
;
Francois