XGCIParamGet参数描述的使用
...
ret= XuguCIExecute(connp->hdstmt);
void* p_colshd;
int bf_zs[1000]={0};
int col_c_type[1000]={0};
int col_sql_type[1000]={0};
int field_num;
uint32 rp_len=4;
ret= XuguCIAttrGet(connp->hdstmt,HT_STATEMENT,&field_num,(uint32 *)&rp_len,XuguCI_ATTR_COL_COUNT);
char ** p_colname =(char**)malloc( sizeof(char*)*field_num);
char ** p_ctypename = (char**)malloc( sizeof(char*)*field_num);
char** p_buff=(char**)malloc( sizeof(char*)*field_num);
int* aLen =(int*)malloc( sizeof(int)*field_num);
int rp;
int* rpi =(int*)malloc( sizeof(int)*field_num);
int j;
int i=1;
ret = XuguCIParamGet(connp->hdstmt,HT_STATEMENT,&p_colshd,i);
while (ret == XuguCI_SUCCESS)
{
p_colname[i-1]=(char*)malloc(128);
p_ctypename[i-1]=(char*)malloc(64);
rp_len=128;
XuguCIAttrGet((XuguCIHANDLE)p_colshd,XuguCI_DTYPE_PARAM,p_colname[i-1],&rp_len,XuguCI_ATTR_NAME);
rp_len=64;
XuguCIAttrGet((XuguCIHANDLE)p_colshd,XuguCI_DTYPE_PARAM,p_ctypename[i-1],&rp_len,XuguCI_ATTR_TYPE_NAME);
int c_type;
int bfsz;
XuguCIAttrGet((XuguCIHANDLE)p_colshd,XuguCI_DTYPE_PARAM,&c_type,&rp_len,XuguCI_ATTR_DATA_TYPE);// data_ctype
XuguCIAttrGet((XuguCIHANDLE)p_colshd,XuguCI_DTYPE_PARAM,&bfsz,&rp_len,XuguCI_ATTR_DATA_SIZE); // databuffer length
int sql_type;
XuguCIAttrGet((XuguCIHANDLE)p_colshd,XuguCI_DTYPE_PARAM,&sql_type,&rp_len,XuguCI_ATTR_SQL_TYPE);// sql_type
if(-1==bfsz)
bfsz=300;
if(c_type ==Xugu_C_CHAR)
bfsz+=1;
bf_zs[i-1]=bfsz;
col_c_type[i-1]=c_type;
col_sql_type[i-1]=sql_type;
ret = XuguCIHandleFree((XuguCIHANDLE)p_colshd);
i++;
ret = XuguCIParamGet(connp->hdstmt,HT_STATEMENT,&p_colshd,i);
//next handle
}
for(j=0;j<field_num;j++)
{
printf(" %s %s |" ,p_colname[j],p_ctypename[j]);
}
printf("\r\n=====================================================\r\n");
...
详见:demo1里面的 GetAllColAttr()函数