I want to get the list of items from a database as a Java resultset. When I use the following SQL statement it works perfectly fine
SELECT First_Name FROM dbo.Names where First_Name LIKE 'A%';
However when I pass it as a parameter, it does not work
I have tried a variety of parameter constructs, but to no use.Some that I have tried are as follows
SELECT First_Name FROM dbo.Names where First_Name LIKE '%' +@letter+ '%'";
SELECT First_Name FROM dbo.Names where First_Name LIKE @letter";
SELECT First_Name FROM dbo.Names where First_Name LIKE &letter&";
SELECT First_Name FROM dbo.Names where First_Name LIKE '&letter&'";
SELECT First_Name FROM dbo.Names where First_Name LIKE +letter+";
SELECT First_Name FROM dbo.Names where First_Name LIKE '+letter+'";
Any workable solution is greatly appreciated
Thanks
Raghu