Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello, My problem at first seems like an easy issue to be fix, but I've spent 3 hours trying to solve this.

I want to use this expression
SQL
Select p.* from persona p where p.firstname like '%+?+%'

I had try the following
SQL
- Select p.* from persona p where p.firstname like "'%"+?+"%'"
- Select p.* from persona p where p.firstname like '%'+?+'%'
- Select p.* from persona p where p.firstname like ? (?='%parameter%')


but all the above gives me a error or doesn't returns any rows even when there is row that match the expression.

How should I make the query, I'm using c# with DataSet , postgreSQL

Regards
Gabriel
Posted
Updated 25-Aug-13 19:11pm
v2

try this...
SQL
Select 
   p.* 
from persona p 
where p.firstname like CONCAT('%',  ?  ,'%')

Happy Coding!
:)
 
Share this answer
 
Problem solved!!!

Thanks Aarti
 
Share this answer
 
Comments
Aarti Meswania 28-Aug-13 14:15pm    
Welcome,
Glad to help you! :)

you should use "Have a Question or Comment?" button given below particular que-ans.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900