Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add prefix, suffix, infix template funcs #14

Closed
pinzolo opened this issue Jul 31, 2018 · 0 comments
Closed

Add prefix, suffix, infix template funcs #14

pinzolo opened this issue Jul 31, 2018 · 0 comments

Comments

@pinzolo
Copy link
Owner

pinzolo commented Jul 31, 2018

-- template
SELECT *
FROM items
WHERE note1 LIKE /*% infix "note1" %*/''
OR note2 LIKE /*% prefix "note2" %*/''
OR note2 LIKE /*% suffix "note3" %*/''
-- translated
SELECT *
FROM items
WHERE note1 LIKE '%' || $1 || '%' ESCAPE '\'
OR note2 LIKE '%' || $2 ESCAPE '\'
OR note2 LIKE $3 || '%' ESCAPE '\'

points

  • Oracle does not have default escapce char, so always use ESCAPE.
  • Oracle uses '%' (full width percent) and '_' (full width underscore) as wildcard.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant