Thank you, Doug..
So, the input comes from the prompt.
The string entered will have text separated by |. For example: abcde|ef|ghi|
The string can be any length and can have any |.
Now I have to check if there are any matches in the database like this -
1: abcde
2: abcde|ef
3: abcde|ef|ghi
3: abcde|ef|ghi% (any thing that starts with abcde|ef|ghi)