IBM Books

Image Extender、Audio Extender 和 Video Extender 管理和程序设计


更新表中的数据

Anita Jones 用最新的照片替换 Employee 表中她的照片。新照片的内容在服务器文件中。

用户的工作:用户使用包括 SQL 语句的应用程序替换 employee 表中的照片,这些 SQL 语句显示在下例中。



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';

发生的情况:作为对 UPDATE 语句中的 Replace UDF 的响应,Image Extender 读取新图象的属性。Image Extender 使用新图象的属性来更新存储在管理支持表中的旧图象属性。图象源在名为 newone.bmp 的服务器文件中。将文件的内容以 BLOB 形式插入管理支持表记录中, 并替换旧图象的 BLOB 内容。

触发器替换各种管理支持表中的图象属性数据。


[ 页的顶部 | 上一页 | 下一页 | 目录 | 索引 ]