IBM Books

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

用于更新的 Content UDF 格式

Content UDF 是重载的,即它随使用此 UDF 的方法的不同而具有不同的格式。格式如下:

格式 1:从客户机缓冲区或客户机文件更新对象:

Content(
     handle,                     /* object handle */
     content,                    /* object content */
     source_format,              /* source format */
     target_file                 /* target file name for storage in file */
                                 /* server or NULL for storage in table as BLOB */
  );

格式 2:从服务器文件更新对象:

Content(
     handle,                     /* object handle */
     source_file,                /* server file name */
     source_format,              /* source format */
     stortype                    /* MMDB_STORAGE_TYPE_EXTERNAL=store */
                                 /* in file server */
                                 /* MMDB_STORAGE_TYPE_INTERNAL=store as a BLOB*/
  );

格式 3:从客户机缓冲区或客户机文件更新具有用户提供的属性的对象:

Content(
     handle,                   /* object handle */
     content,                  /* object content */
     target_file,              /* target file name for storage in file server */
                               /* or NULL for storage in table as BLOB */
     attrs,                    /* user-supplied attributes */
     thumbnail                 /* thumbnail (image and video only) */
  );

格式 4:从服务器文件更新具有用户提供的属性的对象:

Content(
     handle,                   /* object handle */
     source_file,              /* source file name */
     stortype,                 /* MMDB_STORAGE_TYPE_EXTERNAL=store */
                               /* in file server*/
                               /* MMDB_STORAGE_TYPE_INTERNAL=store */
                               /* as a BLOB*/
     attrs,                    /* user-supplied attributes */
     thumbnail                 /* thumbnail (image and video only) */
  );

Content UDF 有下列附加格式(仅针对图象对象):

格式 5: 从客户机缓冲区或客户机文件更新图象,并进行格式转换:

Content(
     handle,                     /* object handle */
     content,                    /* object content */
     source format,              /* source format */
     target format,              /* target format */
     target_file                 /* target file name for storage in file server */
                                 /* or NULL for storage in table as BLOB */
  );

格式 6: 从服务器文件更新对象,并进行格式转换:

Content(
     handle,                     /* object handle */
     source_file,                /* server file name */
     source format,              /* source format */
     target format,              /* target format */
     target_file                 /* target file name for storage in file server */
                                 /* or NULL for storage in table as BLOB */
  );

格式 7: 从客户机缓冲区或客户机文件更新图象,并进行格式转换和其他更改:

Content(
     handle,                     /* object handle */
     content,                    /* object content */
     source format,              /* source format */
     target format,              /* target format */
     conversion_options,         /* conversion options */ 
     target_file                 /* target file name for storage in file server */
                                 /* or NULL for storage in table as BLOB */
  );

格式 8: 从服务器文件更新对象,并进行格式转换和其他更改:

Content(
     handle,                     /* object handle */
     source_file,                /* server file name */
     source format,              /* source format */
     target format,              /* target format */
     conversion_options,         /* conversion options */
     target_file                 /* target file name for storage in file server */
                                 /* or NULL for storage in table as BLOB */
  );

例如,C 应用程序中的下列语句更新 Employee 表中的图象。用于更新的源内容在名为 ajones.bmp 的服务器文件中。已更新的图象以 BOLB 形式存储在 employee 表中。(这与上面的格式 2 相对应。)

EXEC SQL UPDATE EMPLOYEE
   SET PICTURE=CONTENT(
                 PICTURE,                         /*image handle*/
                 '/employee/newimg/ajones.bmp',   /*source file */
                 'ASIS',                          /*keep the image format*/
                 '');                             /*store image in DB as BLOB*/
   WHERE NAME='Anita Jones';

C 应用程序中的下列语句将要更新的图象与前例中的相同。但在此处, 更新时将把该图象由 BMP 格式转换为 GIF 格式。(这与上面的格式 6 相对应。)

EXEC SQL UPDATE EMPLOYEE
   SET PICTURE=CONTENT(
                 PICTURE,                         /*image handle*/
                 '/employee/newimg/ajones.bmp',   /*source file */
                 'BMP',                           /*source format*/
                 'GIF',                           /*target format*/
                 '');                             /*store image in DB as BLOB*/
   WHERE NAME='Anita Jones';


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