DBINT clen;
long sqlType;
for ( i = 0; i < colnums; i++)
{
clen = dbcollen(dbProcess,i+1);
sqlType = dbcoltype(dbProcess,i+1);
//
mData.sqltype = sqlType;
mData.len = clen;
//
switch ((int)sqlType)
{
case SYBNUMERIC:
case SYBDECIMAL:
case SYBBIT:
case SYBINT1:
case SYBINT2:
case SYBINT4:
case SYBINTN:
case SYBFLT8:
case SYBREAL:
case SYBFLTN:
case SYBDATETIME4:
case SYBDATETIME:
case SYBDATETIMN:
case SYBMONEY:
case SYBMONEYN:
case SYBMONEY4:
clen = DB_NUMERIC_LEN ;
break;
case SYBVARBINARY:
case SYBLONGBINARY:
case SYBBINARY:
case SYBIMAGE:
case SYBLONGCHAR:
case SYBTEXT:
case SYBVOID:
clen *= 2;
break;
default:
break;
}
// mData.data = new char[clen+1];
memset(mData.data, 0, sizeof(mData.data));
}
//捆绑对应的数据
for (i=0;i<colnums;i++)
{
if (dbbind(dbProcess, (i + 1), NTBSTRINGBIND,(DBINT)0, (unsigned char *)mData.data) == FAIL)
{
printf("5\n");
}
printf("data=%s,sqltype=%d,len=%d\n", mData.data ,mData.sqltype, mData.len);
}
//读取每一行数据
for ( i = 0; i < colnums; i++)
{
clen = dbcollen(dbProcess,i+1);
sqlType = dbcoltype(dbProcess,i+1);
//
mData.sqltype = sqlType;
mData.len = clen;
//
switch ((int)sqlType)
{
case SYBNUMERIC:
case SYBDECIMAL:
case SYBBIT:
case SYBINT1:
case SYBINT2:
case SYBINT4:
case SYBINTN:
case SYBFLT8:
case SYBREAL:
case SYBFLTN:
case SYBDATETIME4:
case SYBDATETIME:
case SYBDATETIMN:
case SYBMONEY:
case SYBMONEYN:
case SYBMONEY4:
clen = DB_NUMERIC_LEN ;
break;
case SYBVARBINARY:
case SYBLONGBINARY:
case SYBBINARY:
case SYBIMAGE:
case SYBLONGCHAR:
case SYBTEXT:
case SYBVOID:
clen *= 2;
break;
default:
break;
}
// mData.data = new char[clen+1];
memset(mData.data, 0, sizeof(mData.data));
}
//捆绑对应的数据
memset(mData[0].data, 0x00, sizeof(mData[0].data));
memset(mData[1].data, 0x00, sizeof(mData[1].data));
for (i=0;i<colnums;i++)
{
if (dbbind(dbProcess, (i + 1), NTBSTRINGBIND,(DBINT)0, (unsigned char *)mData.data) == FAIL)
{
printf("5\n");
}
printf("data=%s,sqltype=%d,len=%d\n", mData.data ,mData.sqltype, mData.len);
}
//读取每一行数据