Feedback
Did this article resolve your question/issue?

   

Article

SQL Server Wire Protocol driver gives SQL parser error

Information

 
TitleSQL Server Wire Protocol driver gives SQL parser error
URL NameSQL-Server-Wire-Protocol-driver-gives-SQL-parser-error
Article Number000178835
EnvironmentProduct: Connect64 for ODBC SQL Server Wire Protocol driver
Version: 07.16.0292
OS: Windos 64-bit
Database: SQL Server 2008R2 SP1
Application: ODBC Test
Question/Problem Description
SQL parser error on SQLDescribeParam when updating SQL Server with nested select query
Steps to ReproduceSteps to reproduce issue:

1) Connect to SQL Server using the SQL Server Wire Protocol driver and ODBC Test

2) SQLExecDirect:
CREATE TABLE test1
(
id int,
col2 int,
col3 int
)

3) SQLExecDirect:
CREATE TABLE test2
(
parent_id int,
name varchar(10),
id int
)

4) SQLExecDirect:insert into test1 values (10, 1, 1)

5) SQLExecDirect:insert into test2 values (10, 'ABC', 1)

6) SQLPrepare:
update test2
set parent_id = (SELECT top (1) id from test1 where col2 = ? order by col3 desc)
where id = 1

7) SQLNumParams

8) SQLDescribeParam: 1

Observed Results:
The below error is observed.

Expected Results:
No error should be observed.
Clarifying Information
Error Message[HY000][DataDirect][ODBC SQL Server Wire Protocol driver]Error encountered during the SQL Parsing.
Defect Number
Enhancement Number
Cause
Resolution
Upgrading to SQL Server Wire Protocol driver version 07.16.0303 (B0314, U0208) or higher resolved the issue.
Workaround
Split the update statement into two separate ones, passing result of select as parameter into update.
Notes
Last Modified Date10/7/2016 8:55 PM
Files
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.