You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The values that we are looking at look like serialized JSON.
To Reproduce
Create a simple table with at least one column Options set to nvarchar(max). Set values exactly like follows in this field (including the backslashes, quotes, etc.):
[\"COUNTY\"],[\"STATE\"],[\"COUNTRY\"]
Code:
letcmd=new SqlCommandProvider<" SELECT * FROM MyDataTable dl WHERE dl.Options like '%\"@logTblName\\%';",connectionString>(connectionString)
cmd.Execute(logTblName="STATE")
Error
Error message:
error FS0495: The member or object constructor 'Execute' has no argument or settable return property 'logTblName'. The required signature is SqlCommandProvider<...>.Execute() : Collections.Generic.IEnumerable<SqlCommandProvider<...>.Record>.
Expected behavior
It should recognize @logTblName as a parameter.
What you can do
I am willing to contribute a PR with a unit test showcasing the issue***
I am willing to test the bug fix before next release
The *** is because I don't know enough to fix this, but may be able to do so with (a lot of) guidance.
EDIT: Fixed F#.
The text was updated successfully, but these errors were encountered:
@sachinshahredmane, this isn't achievable, the SQL parser itself wouldn't accept the statement.
What you can do, is have like @logTblName in your statement, and put the patterns (and escape %) in the parameter itself; I think this would fit your need, but please let us know.
Issue Summary
The following SQL in SqlCommandProvider doesn't recognize
@logTblName
as a substitution variable.First, here is the raw SQL that works in SSMS:
The values that we are looking at look like serialized JSON.
To Reproduce
Create a simple table with at least one column
Options
set tonvarchar(max)
. Set values exactly like follows in this field (including the backslashes, quotes, etc.):Code:
Error
Error message:
Expected behavior
It should recognize
@logTblName
as a parameter.What you can do
The *** is because I don't know enough to fix this, but may be able to do so with (a lot of) guidance.
EDIT: Fixed F#.
The text was updated successfully, but these errors were encountered: