Select Categories Below
Advertisement
Start Your Own Q&A Site
Create your own Q&A site easily, allowing you to quickly grow a new community around any subject matter or generate new organic traffic for your existing website.
Status: Closed Points: 75 Time: 05:12 - Dec 08, 2006
theDude
I need to make a query like the following: from Product WHERE field1 LIKE 'bla%' but the "bla" is a parameter that I would like to add as a named parameter. So it tried: from Product WHERE field1 LIKE :field1 + '%' But that doesn't give me any results. Anyone knows how to do this?
Categories:
Add Categories
When adding more than one category, separate them with commas.
Sergio Costa
Date:: Jan 05, 2007
Time:: 11:02
"select * from Product WHERE field1 LIKE @p1; @p1='blah%' "
Date:: Jan 06, 2007
Time:: 09:25
great, exactly what I was looking for. I'll try it out and you'll get the points afterwards.
Date:: Jan 27, 2007
Time:: 07:31
hmmm, i have tried it now, but it doesn't work. are you sure that your example is for the NHibernate query language? I'm not looking for an SQL way of doing it...
Date:: Jun 04, 2007
Time:: 01:46
didn't find the solution for this, but gotta close the question...
rajnarrayan500
Date:: Jan 16, 2009
Time:: 00:38
<query name="SEARCH_BLA"> <![CDATA[ Product WHERE field1 LIKE :field1]]>> </query> dONOT USE ANY % FOR HQL . HOPE THIS WILL SOLVE.
robertstackhouse
Date:: May 18, 2010
Time:: 16:38
string queryString = "from Product product where product.field1 like :field1"; IQuery query = session.CreateQuery(queryString); query.SetParameter("field1", "%" +field1+ "%"); IList<Product> products = query.List<Product>();
Question Answered
This question has been closed, and points have been rewarded to the following experts:
You're welcome however to comment or give additional information or if you wish, you have the ability to write a Tutorial in the Tutorial Area.
Answer this Question
New User
Email:
Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address
Registered User
Username:
Password:
Forgot Your Password?
Enter your email address below and we will resend your login information to you.
Login Information Sent
Questions
whats the best food to eat during midnight?
How to identify the tiffany jewelry? www.tffanycheapmall.com.
Send an email alert to each user of the php application based on criteria
How I Increased My AdSense Earnings?
how to choose the lady dress ?
How can I fulfill the minimum requirement to make your computer support 3D?
You have 100 characters to use
Rank
Expert
Points
1.
10354
2.
6493
3.
5596
4.
4848
5.
3487
6.
2840
7.
2770
8.
2303
9.
1820
10.
917
Register today to share your knowledge with the community and be recognized and rewarded for your contributions.
Register Here
"Psst, Quomon is a great site. Pass it on." Tell a Friend | Link To Us | Save to Delicious | Digg it
Language Options
English:
Español:
Sponsors
Questions and Answers Software