BUG: Invalid Syntax on SQLNumResultCols After Update ProcLast reviewed: August 13, 1997Article ID: Q135311 |
The information in this article applies to:
SYMPTOMSThe Microsoft Open Data Base Connectivity (ODBC) Open Data Services (ODS) Gateway driver which ships with SQL Server versions 4.21 and 4.21a gets an incorrect syntax error if SQLNumResultCols is called right after a SQLExecDirect of a procedure whose last step is an UPDATE, DELETE, or INSERT statement. With a stored procedure of the following format:
create procedure Insert_Num @key int, @value char(3) as insert into NumResults values (@key, @value) goThe procedure is correctly executed in Transact_SQL syntax by the ODBC ODS Gateway driver:
SQLExecDirect(hstmt, "Insert_Num @key = 1, @value = 'aaa' ",SQL_NTS);but a call to SQLNumResultCols immediately after the SQLExecDirect fails with the error:
SqlState = 37000, pfNative = 170 szErrorMsg = "Line 1: Incorrect syntax near 'Insert_Num' " CAUSEThe error only occurs if the procedure is executed in Transact-SQL syntax, not if the procedure is executed in ODBC syntax.
WORKAROUNDSQLNumResultCols works correctly if the procedure is executed in ODBC syntax:
SQLExecDirect(hstmt, "{ call Insert_Num (1, 'aaa')}", SQL_NTS); STATUSMicrosoft has confirmed this to be a problem in the Microsoft ODBC ODS Driver version 1.02.3731. We are researching this problem, and will post new information here in the Microsoft Knowledge Base as it becomes available. The problem does not occur in the Microsoft ODBC ODS Driver version 2.50.0121 that ships with SQL Server version 6.0
|
Additional query words:
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |