简体   繁体   English

SQL_NEED_DATA以简单整数返回

[英]SQL_NEED_DATA returned on simple integer

ALL, 所有,

I am having a weird situation. 我的状况很奇怪。 I modified one of my queries adding the 3rd parameter of type int and now trying to bind the integer value to it. 我修改了我的一个查询,添加了int类型的第3个参数,现在尝试将整数值绑定到它。 The call is as follows: 调用如下:

ret = SQLBindParameter( stmt_tableProp, 3, SQL_PARAM_INPUT, SQL_C_SLONG, SQL_INTEGER, 0, 0, &tableId, 0, &cbId );

The value of the tableId is 171147655 . tableId值为171147655

After adding this function the call to SQLExecute() starts returning SQL_NEED_DATA. 添加此函数后,对SQLExecute()的调用开始返回SQL_NEED_DATA。

In the table the column is of the type integer . 在表中,该列的类型为integer

I don't understand this - I am not passing big data to the query and I am not using BLOB. 我不明白这一点-我没有将大数据传递给查询,也没有使用BLOB。

Why am I getting the SQL_NEED_DATA? 为什么我得到SQL_NEED_DATA?

If I take the 3 parameter out everything works again. 如果我取出3参数,一切将再次起作用。

Could someone please help? 有人可以帮忙吗?

TIA! TIA!

This behaviour occurs if the last parameter of the SQLBindParameter function ( StrLen_or_IndPtr ) is set to SQL_DATA_AT_EXEC . 如果将SQLBindParameter函数的最后一个参数( StrLen_or_IndPtr )设置为SQL_DATA_AT_EXEC则会出现此行为。

You should check the value of your cbId variable. 您应该检查cbId变量的值。

The error also seems to occur if you do not initialize the provided variable. 如果不初始化提供的变量,似乎也会发生该错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM