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 ÀÀ¿ëÇÁ·Î±×·¥¿¡ ÀÖ´Â ´ÙÀ½ ¸í·É¹®Àº Á÷¿ø Å×À̺íÀÇ À̹ÌÁö¸¦ °»½ÅÇÕ´Ï´Ù. °»½Å¿¡ ´ëÇÑ ¼Ò½º ³»¿ëÀº ajones.bmp¶ó´Â ¼¹ö ÆÄÀÏ¿¡ ÀÖ½À´Ï´Ù. °»½ÅµÈ À̹ÌÁö´Â Á÷¿ø Å×ÀÌºí¿¡ BLOBÀ¸·Î ÀúÀåµË´Ï´Ù. (À̰ÍÀº ¾Õ¿¡¼ ¼³¸íÇÑ Çü½Ä 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';