Anita Jones replaces her picture in the employee table with a more recent picture. The content of the newer picture is in a server file.
What the user does: The user replaces the picture in the employee table by using an application program that includes the SQL statements that are shown in the following example.
EXEC SQL BEGIN DECLARE SECTION; char hvComment [16385]; long hvStorageType; EXEC SQL END DECLARE SECTION; strcpy(hvComment, "Picture taken at Anita's promotion"); hvStorageType=MMDB_STORAGE_TYPE_INTERNAL; EXEC SQL UPDATE EMPLOYEE SET PICTURE=REPLACE( PICTURE, /*image handle*/ '/myimages/newone.bmp', /*source image content*/ 'BMP', /*source format*/ :hvStorageType, /*store image in table as BLOB*/ :hvComment) /*replace comment*/ WHERE NAME='Anita Jones'; |
What happens: In response to the Replace UDF in the UPDATE statement, the Image Extender reads the attributes of the new image. The Image Extender uses the attributes of the new image to update the attributes stored in the administrative support tables for the old image. The image source is in a server file that is named newone.bmp. The content of the file is inserted into the administrative support table record as a BLOB, replacing the BLOB content of the old image.
Triggers replace the image attribute data in various administrative support tables.