Bug #42776 | Cannot use variables in sql | ||
---|---|---|---|
Submitted: | 12 Feb 2009 3:02 | Modified: | 31 Mar 2009 16:35 |
Reporter: | Matt Zyzik | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | Connector / NET | Severity: | S3 (Non-critical) |
Version: | 5.2 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | variables |
[12 Feb 2009 3:02]
Matt Zyzik
[12 Feb 2009 21:07]
Tonci Grgin
Hi Matt and thanks for your report. Can you please attach complete test case including your connect string so I can check.
[13 Feb 2009 4:25]
Matt Zyzik
test case
Attachment: case.tar.gz (application/gzip, text), 116.42 KiB.
[13 Mar 2009 0:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".
[13 Mar 2009 7:15]
Tonci Grgin
Sorry, my mistake. Analyzing.
[31 Mar 2009 16:35]
Reggie Burnett
This is not a bug. The default behavior is that the provider will look for variables (strings starting with ? or @) and assume they are parameters that should be set. If not, it throws an error. If you want to run sql that contains these strings, then you need to set 'Allow User Variables=true' on your connection string. This will cause the provider to find the variables and see if there is a parameter of that name. If there is, it uses it. If not, it assumes it is a user variable and accepts it.