DB2 - Problem description
Problem IT32956 | Status: Closed |
DB2 .NET PROVIDER WITH DOUBLE HYPHENS (--) STYLE COMMENT IN SQL STATEMENT HAVING NAMED PARAMETERS THROWS SQL0206N | |
product: | |
DB2 CONNECT / DB2CONNCT / B50 - DB2 | |
Problem description: | |
This issue occurs when double hyphens (--) style comment containing a single quote( ' ) with named parameters is used in SQL statement (with Db2 .NET provider). The issue reproduces with the following query in a .NET application: -- Removing this single quote causes the query to work: ' SELECT * FROM SYSIBM.SYSDUMMY1 WHERE IBMREQD = @parameter The application gets an error that indicates that there is something wrong with the parameter value, but it works fine without the comment: ERROR [42703] [IBM][DB2] SQL0206N "@PARAMETER" is not valid in the context where it is used. By removing the single quote from the comment, we don't get any error. Also if named parameter in SQL statement is changed to positioned parameters, by using the question mark (?) parameter marker, then application works fine. | |
Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * 2 * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * The fix will be delivered in 11.5m7fp0, please upgrade to * * 11.5m7fp0 .NET provider * **************************************************************** | |
Local Fix: | |
As a workaround, customer can use C-style slash-and-asterisk ( /* . . . */ ) comment in SQL statement. | |
Solution | |
Workaround | |
**************************************************************** * USERS AFFECTED: * * 2 * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * The fix will be delivered in 11.5m7fp0, please upgrade to * * 11.5m7fp0 .NET provider * **************************************************************** | |
Comment | |
.NET Application with DB2 .NET provider with double hyphens (--) style comment in SQL statement having named parameters throws ERROR [42703] [IBM][DB2] SQL0206N "@PARAMETER" is not valid in the context where it is used. The fix will be delivered in 11.5m7fp0 | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 22.05.2020 10.06.2021 10.06.2021 |
Problem solved at the following versions (IBM BugInfos) | |
Problem solved according to the fixlist(s) of the following version(s) |