I am using a MS SQL database and I am on a premium license of MYDBR 4.3.1 build 2525
I have been using this product for about 6 months now to successfully run basic select statements but I wanted to try adding some search functionality by using parameters but I've been banging my head against the wall for the past two hours and just can not figure it out.
I can create a SP and it works just fine but as soon as I try to add a parameter to it I get an incorrect syntax message.
Here's the code that works:
CREATE PROCEDURE sp_DBR_testparameters
AS
BEGIN
SELECT *
FROM mytable
END
GO
I am simply trying to reproduce the example in the documentation at this point so I modify it to be:
CREATE PROCEDURE sp_DBR_testparameters( vFilmName nvarchar(30) )
AS
BEGIN
SELECT *
FROM mytable
where notes like concat('%',vFilmName,'%');
END
GO
but when I execute this it says:
message: Incorrect syntax near 'vFilmName'.
Your procedure has not been saved to database.
Fix the error or revert back to original.
even when I comment out the WHERE clause I still get the error message which tells me that I am probably either defining the parameter incorrectly or possibly have some settings wrong in the application?
Any ideas on what I am doing wrong?
Thanks!