Link to home
Start Free TrialLog in
Avatar of saffar4ever
saffar4ever

asked on

How to use more than one percentage sign in queries in OrientDB?

How to use more than one percentage sign in queries in OrientDB?

For example : select from MyNode where MyNodeText.toLowerCase() like '%text1%text2%'
This does not work
Avatar of David Favor
David Favor
Flag of United States of America image

First off say what you're really trying to match.

Are you looking for a string containing % or trying to create a complex regular expression with multiple %.

The first will likely be easy. Most SQL variants support %% to escape the % character.

The second will work exactly as you have it written, at least for most SQL variants.

Docs for your version of OrientDB will provide correct answers to your questions.
Avatar of saffar4ever
saffar4ever

ASKER

Hi,

I am trying to find values that contain text1 followed by text2. any character before text1 and after text 2 is allowed and any character between them is allowed.
ASKER CERTIFIED SOLUTION
Avatar of NerdsOfTech
NerdsOfTech
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>> any character before text1 and after text 2 is allowed and any character between them is allowed. <<
Are you saying any single character is allowed in those locations or any group of characters? Can you provide some sample data and what you expect for results (include an example where '%text1%text2%' doesn't work).
@awking00

Are you saying any single character is allowed in those locations or any group of characters?
I mean any group of characters

Can you provide some sample data and what you expect for results (include an example where '%text1%text2%' doesn't work).
Suppose the data is 'all the time'. If I search '%all%time%', the OrientDB returns nothing. I'm guessing it is a syntax problem.

@NerdsOfTech
Thank you NerdsOfTech. Regular expressions worked for me.