ST_AsBinary´Â ±âÇÏÇÐ ¿ÀºêÁ§Æ®¸¦ ÃëÇØ Àß ¾Ë·ÁÁø 2Áø Ç¥Çö½ÄÀ» ¸®ÅÏÇÕ´Ï´Ù. ST_AsBinary´Â ÀÔ·ÂÀ¸·Î ºó ±âÇÏÇÐÀ» ÃëÇÒ ¼ö ¾ø½À´Ï´Ù(SQLSTATE 38827).
±¸¹®
db2gse.ST_AsBinary(g db2gse.ST_Geometry)
¸®ÅÏ À¯Çü
BLOB(1m)
¿¹
´ÙÀ½ Äڵ忡¼´Â ST_AsBinary ÇÔ¼ö°¡ BUILDINGFOOTPRINTS Å×À̺íÀÇ À§Ä¡ ´ÙÁß ´Ù°¢ÇüÀ» WKB ´ÙÁß ´Ù°¢ÇüÀ¸·Î º¯È¯ÇÏ´Â ¹æ¹ý¿¡ ´ëÇØ ¼³¸íÇÕ´Ï´Ù. ÀÌ ´ÙÁß ´Ù°¢ÇüÀº ȸéÇ¥½Ã¿ë ÀÀ¿ëÇÁ·Î±×·¥ÀÇ draw_polygon ÇÔ¼ö¿¡ Àü´ÞµË´Ï´Ù.
/* SQL Ç¥Çö½ÄÀ» ÀÛ¼ºÇÕ´Ï´Ù. */ strcpy(sqlstmt, "select db2gse.ST_AsBinary (footprint) from BUILDINGFOOTPRINTS where db2gse.EnvelopesIntersect(footprint, db2gse.ST_PolyFromWKB (cast(? as blob(1m)), db2gse.coordref()..srid(0)))"); /* SQL¹®À» ÁغñÇÕ´Ï´Ù. */ SQLPrepare(hstmt, (UCHAR *)sqlstmt, SQL_NTS); /* ¸ð¾çÀÇ pcbvalue1 ±æÀ̸¦ ¼³Á¤ÇÕ´Ï´Ù. */ pcbvalue1 = blob_len; /* ¸ð¾ç ¸Å°³º¯¼ö¸¦ ¹ÙÀεåÇÕ´Ï´Ù. */ SQLBindParameter (hstmt, 1, SQL_PARAM_INPUT, SQL_C_BINARY, SQL_BLOB, blob_len, 0, shape, blob_len, &pcbvalue1); /* Á¶È¸ ½ÇÇà */ rc = SQLExecute (hstmt); /* Assign the results of the query (the Zone polygons) to the fetched_binary variable. */ SQLBindCol (hstmt, 1, SQL_C_Binary, fetched_binary, 100000, &ind_blob); /* ȸéÇ¥½Ã â ¾ÈÀÇ °¢ ´Ù°¢ÇüÀ» »çÀü ÃßÃâÇÏ¿© Ç¥½ÃÇÕ´Ï´Ù. */ while(SQL_SUCCESS == (rc = SQLFetch(hstmt))) draw_polygon(fetched_binary);