|
|
|
|
SQLNumResults() fails, when text parameter is binded as SQL_WLONGVARCHAR after calling SQLExecDirect
Hi,
I am trying to send large text to a stored procedure which takes parameter
as 'text' type as given below,
TestLargeText(largeText text, nValue1 int .. )
I am exeucting the above SP using ODBC apis as given below
- SQLBindParameter to bind the parameter with Data at execution time option
set
- Binding paramter as SQL_WLONGVARCHAR if text size is more than 4k
otherwise SQL_WVARCHAR
- Sending data at execution time in chunks..by calling SQLPutData in a loop.
- SQLExecDirect to execute the stored procedure
- SQLNumResults to check if stored procedure returns any result sets
In the above sequence, call to SQLNumResults() is passing if i bind to
SQL_WVARCHAR
but when text is more than 4k, and if i bind to SQL_WLONGVARCHAR the call to
SQLNumResults is failing and the error popped up is
[Microsoft][ODBC SQL Server Driver]Associated statement is not prepared
*** Is it allowed to call SQLNumResults after SQLExecDirect when we bind the
parameter with Data at Execution option. ???
with regards
Amaresh
| |