O AsBinaryShape pega um objeto de geometria e apresenta um BLOB.
Sintaxe
db2gse.AsBinaryShape(g db2gse.ST_Geometry)
Tipo de retorno
BLOB(1m)
Exemplos
O fragmento de código a seguir demonstra como a função do AsBinaryShape converte os polígonos de zona da tabela SENSITIVE_AREAS em polígonos shape. Tais polígonos shape são passados para a função de desenho do polígono (draw_polygon) exibição.
/* Criar a expressão SQL. */ strcpy(sqlstmt, "select db2gse.AsBinaryShape (zone) from SENSITIVE_AREAS where db2gse.EnvelopesIntersect(zone, db2gse.PolyFromShape(cast(? as blob(1m)), db2gse.coordref()..srid(0)))"); /* Preparar as instruções SQL. */ SQLPrepare(hstmt, (UCHAR *)sqlstmt, SQL_NTS); /* Definir o comprimento de pcbvalue1 do shape. */ pcbvalue1 = blob_len; /* Fazer o bind do parâmetro do shape */ SQLBindParameter (hstmt, 1, SQL_PARAM_INPUT, SQL_C_BINARY, SQL_BLOB, blob_len, 0, shape, blob_len, &pcbvalue1); /* Executar a consulta */ rc = SQLExecute (hstmt); /* Atribuir os resultados da consulta (os polígonos da Zone) a fetched_binary variable. */ SQLBindCol (hstmt, 1, SQL_C_Binary, fetched_binary, 100000, &ind_blob); /* Buscar cada polígono dentro da janela de exibição e exibi-lo. */ while(SQL_SUCCESS == (rc = SQLFetch(hstmt))) draw_polygon(fetched_binary);