stevensteven
Programmer
I am calling a SQL stored procedure from my C code to update a database. The problem is that once I call my stored procedure, in my C code, it creates a result set which cost me alot of time to close the cursor before i perform another query. I have added SET NOCOUNT ON to my SQL Server stored procedure, but in my c code I still get a result set back.
Simplified C code
rc = SQLAllocStmt(hdbc, hstmt);
rc = SQLPrepare(*hstmt, "{call AddAnalog(?,?,?)", SQL_NTS);
rc = SQLNumParams (*hstmt, &numParams);
[BINDPARAMETERS CALL]
while(I am looping)
{
rc = SQLExecute(*hstmt);
rc = SQLFreeStmt(*hstmt, SQL_CLOSE); /* Close Cursor */
}
See the problem is that I don't care what gets return from the stored procedure since all my parameters were inputs. But it takes time to create the record set and to close it before I do another stored procedure call.
Any ideas anyone?
Thanks for any help,
Steven
Simplified C code
rc = SQLAllocStmt(hdbc, hstmt);
rc = SQLPrepare(*hstmt, "{call AddAnalog(?,?,?)", SQL_NTS);
rc = SQLNumParams (*hstmt, &numParams);
[BINDPARAMETERS CALL]
while(I am looping)
{
rc = SQLExecute(*hstmt);
rc = SQLFreeStmt(*hstmt, SQL_CLOSE); /* Close Cursor */
}
See the problem is that I don't care what gets return from the stored procedure since all my parameters were inputs. But it takes time to create the record set and to close it before I do another stored procedure call.
Any ideas anyone?
Thanks for any help,
Steven