Page 1 of 1
Error #2032 when trying to use SQL parameter
Posted: Mon May 12, 2014 7:13 am
by Craig
I am trying to use a filter at the data source level. I created a query like: select * from customers where CustomerName = @param1. Then created a parameter called @param1 of type varchar.
When I preview, I get an error #2032 with server message is empty. I am using version 2014.1.1900.
Is this the right way to use a SQL parameter?
Re: Error #2932 when trying to use SQL parameter
Posted: Mon May 12, 2014 10:32 am
by Alex K.
Hello,
Please try to set the default value for parameter.
Also you can try to use the variable instead a parameter:
select * from customers where CustomerName = {Variable1}
Thank you.
Re: Error #2032 when trying to use SQL parameter
Posted: Mon May 12, 2014 4:54 pm
by Craig
When I use your format I get an error message : Incorrect syntax near '}'. Is there documentation or video which shows how to use a parameter in the the SQL query, automatically show a parameter panel in a web page when the report renders and the user supplies a value for the variable. I am looking for a way to supply the value without writing code. Assume end user doesn't know how to code but still knows how to write SQL queries with parameters.
Re: Error #2032 when trying to use SQL parameter
Posted: Tue May 13, 2014 6:24 am
by Alex K.
Hello,
Please see the following video "Using SQL Parameters in Web":
http://www.stimulsoft.com/en/videos?tag ... &type=list
Thank you.
Re: Error #2032 when trying to use SQL parameter
Posted: Wed May 14, 2014 7:15 am
by Craig
This video is not what I am looking for. I want to use a parameter in the where clause. Not parameter to pass a value to stored procedure. You posted a way to use {Variable1} but that gave me an error 'The name 'Variable1' does not exist in the current context'. I also do not want to write c# code to pass the parameter. Is there a way to define a parameter/variable in SQL and when the report renders, a parameter panel shows up (no coding required). I am still confused between how to use a variable vs parameter and how to define a variable/parameter and how to add a parameter/variable under paramaters option and how to associate a SQL parameter/variable with a report parameter/variable.
The idea is for the report to display an automatic parameter panel where the user enters a value for every parameter defined in SQL.
Re: Error #2032 when trying to use SQL parameter
Posted: Thu May 15, 2014 10:20 am
by HighAley
Hello, Craig.
You should add the Variable1 in designer to avoid the error. This variable should has Request From User option set to True. And you could use this variable in the query.
You could get more information from
the Dynamic SQL queries article on our Blog.
Thank you.