Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Object Relational Mapping
Search Coderanch
Advance search
Google search
Register / Login
Win a copy of
Helidon Revealed: A Practical Guide to Oracle’s Microservices Framework
this week in the
Java in General
forum!
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
paul wheaton
Liutauras Vilda
Ron McLeod
Sheriffs:
Jeanne Boyarsky
Devaka Cooray
Paul Clapham
Saloon Keepers:
Scott Selikoff
Tim Holloway
Piet Souris
Mikalai Zaikin
Frits Walraven
Bartenders:
Stephan van Hulst
Carey Brown
Forum:
Object Relational Mapping
HQL + LIKE + _
kri shan
Ranch Hand
Posts: 1491
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I am using LIKE in HQL. Hence it takes all records that matches LIKE including _(under score). But i want to omit under score(_). How ?
kri shan
Ranch Hand
Posts: 1491
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
any update ?
Ulf Dittmer
Rancher
Posts: 43081
77
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Can you tell us what exactly you're trying to do? If you want to match all strings containing an underscore, that character will need to be in the LIKE phrase. What would be the point of keeping it out of the match
pattern
?
kri shan
Ranch Hand
Posts: 1491
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi Ulf, LIKE should match with only characters, not any special characters(_).
kri shan
Ranch Hand
Posts: 1491
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi Ulf Dittmer, Any update ?
Ulf Dittmer
Rancher
Posts: 43081
77
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
How about adding another phrase like "... AND NOT LIKE '%_%'"? Or -for better performance- work with the SQL equivalent of String.indexOf.
Or are there other special characters you want to exclude as well?
By the way, please don't ask for answers from specific people. It makes others -who may have more to contribute- feel excluded and unwelcomed.
kri shan
Ranch Hand
Posts: 1491
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I want to exclude all special characters. How (not using AND NOT LIKE '%_%'")?
kri shan
Ranch Hand
Posts: 1491
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Any update ???
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
FYI on SDK versions for exam
Need Help Figuring Out A Hibernate Criteria Query
Complex math in HQL
two queries combined together into a single one
"like clause" in HQL?
More...