Open bhassel-lincoln opened 6 years ago
https://github.com/amohata007/Hacktoberfest contribute here....it is totally awesome and very easy to contribute. @bhassel-lincoln @jbattermann @aggieben @paulcbetts @SamSaffron
https://www.ibm.com/docs/en/i/7.3?topic=variables-in-dynamic-sql states that named parameters are not supported in "dynamic SQL statements" (which i believe applies here)
Using Dapper for DB2 queries with the IBM.Data.DB2.iSeries driver works well, but there is an issue with the way parameters are handled. DB2 supports named parameters (and positional), but the parameter name MUST begin with the @ symbol, which DynamicParameters strips off by default: https://github.com/StackExchange/Dapper/blob/4e62055c5775aced61b848282ed180de0ab62161/Dapper/DynamicParameters.cs#L139
If the parameters are not named with the @ symbol, the variable matching defaults to positional within the statement, which can introduce hard-to-find bugs.
Because that Clean method is private/static, I don't see an easy way to change that default behavior. Is there some way to make that 'Clean' function optional at the connection/command level?