watersniper
07-03-2013, 10:59 PM
This isn't neopets related, but since you guys are all brilliant programmers, maybe you have some experience and can shed some light?
I'm using enterprise javabeans and have a database which uses EJB-QL (which doesn't seem to recognize REGEXP, otherwise I could use .\\b).
I need to select records containing keywords, eg. "pin". And don't want it to return things "lynchpin" or "pineapple".
Any idea how to do this?
Edit: A clarification on the question --
Essentially my column consists of chunks of text, and I'm looking for the records whose chunk of text contain a keyword.
Normally it would be this way:
SELECT e.column FROM TABLE e WHERE e.column LIKE '%pin%'
However, this will cause records containing text with the terms 'lynchpin' and 'pineapple' to be chosen as well.
So I'm looking for something that will bound the keyword, such as in regex: ".\bpin\b."
Otherwise I will have to select all the records then run the text through a Pattern/Matcher to see if it returns false, which is inefficient.
I'm using enterprise javabeans and have a database which uses EJB-QL (which doesn't seem to recognize REGEXP, otherwise I could use .\\b).
I need to select records containing keywords, eg. "pin". And don't want it to return things "lynchpin" or "pineapple".
Any idea how to do this?
Edit: A clarification on the question --
Essentially my column consists of chunks of text, and I'm looking for the records whose chunk of text contain a keyword.
Normally it would be this way:
SELECT e.column FROM TABLE e WHERE e.column LIKE '%pin%'
However, this will cause records containing text with the terms 'lynchpin' and 'pineapple' to be chosen as well.
So I'm looking for something that will bound the keyword, such as in regex: ".\bpin\b."
Otherwise I will have to select all the records then run the text through a Pattern/Matcher to see if it returns false, which is inefficient.