Skip to content

Is it possible to escape a user input for a LIKE operator? #1494

Answered by muturgan
muturgan asked this question in Q&A
Discussion options

You must be logged in to vote

I like an answer from SO - using position instead of like:

`SELECT * FROM my_table WHERE POSITION(? IN name) > 0',
[ userInput ]

Replies: 2 comments 1 reply

This comment has been hidden.

@muturgan
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by muturgan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants