Image、Audio 及 Video Extenders 管理與程式設計

擷取作業的 Content UDF 格式

Content UDF 已超載,這表示可根據 UDF 的使用方式,決定不同的格式。 其格式如下:

格式 1:將物件擷取至從屬站緩衝區或從屬站檔案:

Content(
     handle,                      /* object handle */
  );

格式 2:將物件的某區段擷取至從屬站緩衝區或從屬站檔案:

Content(
     handle,                      /* object handle */
     offset,                      /* offset where retrieval begins */
     size                         /* number of bytes to retrieve */
  );

格式 3:將物件擷取至伺服器檔案:

Content(
     handle,                      /* object handle */
     target_file,                 /* server file name */
     overwrite                    /* 0=Do not overwrite target file if it exists */
                                  /* 1=Overwrite target file */
 
  );

另外,Content UDF 對影像物件還包括下列格式:

格式 4:將影像擷取至從屬站緩衝區或檔案,並做格式轉換:

Content(
     handle,                      /* object handle */
     target format                /* target format */
       );

格式 5:將物件擷取至伺服器檔案,並做格式轉換:

Content(
     handle,                      /* object handle */
     target_file,                 /* server file name */
     overwrite,                   /* 0=Do not overwrite target file if it exists */
                                  /* 1=Overwrite target file */
     target format                /* target format */
     
  );

格式 6:將物件擷取至從屬站緩衝區或檔案,並做格式轉換及額外變更:

Content(
     handle,                      /* object handle */
     target format,              /* target format */
     conversion_options           /* conversion options */
  );

格式 7:將物件擷取至伺服器檔案,並做格式轉換及額外變更:

Content(
     handle,                      /* object handle */
     target_file,                 /* server file name */
     overwrite,                   /* 0=Do not overwrite target file if it exists */
                                  /* 1=Overwrite target file */
     target format,              /* target format */
     conversion_options           /* conversion options */
  );

例如,下列陳述式會將員工表格中的影像擷取至伺服器的檔案中。(它對應於格式 3。)

EXEC SQL SELECT CONTENT(                 /* retrieval UDF */
                 PICTURE,                              /* image handle */
       '/employee/images/ajones.bmp',      /* target file */
       1)                                /* overwrite target file */
      FROM EMPLOYEE
     WHERE NAME = 'Anita Jones';

下列在 C 應用程式中的陳述式會將員工表格中的影像擷取至伺服器的檔案中。 在擷取影像時會轉換其格式。(它對應於格式 5。)

EXEC SQL BEGIN DECLARE SECTION;
char hvImg_fname[255];
  EXEC SQL END DECLARE SECTION;
 
EXEC SQL SELECT CONTENT(                 /* retrieval UDF */
                 PICTURE,                              /* image handle */
       '/employee/images/ajones.bmp',      /* target file */
       1,                                  /* overwrite target file */
        'GIF')                               /* target format */ 
      INTO :hvImg_fname
      FROM EMPLOYEE
     WHERE NAME = 'Anita Jones';


[ 頁面頂端 | 前一頁 | 下一頁 | 目錄 | 索引 ]