Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to escape a single quote in a dynamic expression with functions?

Tags:

Need to insert a parameter into a string using the dynamic data function from the pipeline parameters. Have tried backslash, double backslash, double single quote,@, @@, and other such nonsense. Just need a simple way to escape a single quote in a string.

like image 993
jamesbascle Avatar asked May 16 '18 01:05

jamesbascle


People also ask

How do you escape a single quote?

Single quotes need to be escaped by backslash in single-quoted strings, and double quotes in double-quoted strings.

How do you escape a single quote in ADF?

Essentially, just use + with escaped single quotes.

How do I ignore a single quote in SQL?

The simplest method to escape single quotes in SQL is to use two single quotes. For example, if you wanted to show the value O'Reilly, you would use two quotes in the middle instead of one. The single quote is the escape character in Oracle, SQL Server, MySQL, and PostgreSQL.

How do you handle a single quote in a string?

A single quote is not used where there is already a quoted string. So you can overcome this issue by using a backslash following the single quote. Here the backslash and a quote are used in the “don't” word. The whole string is accompanied by the '$' sign at the start of the declaration of the variable.


1 Answers

I actually found out. It's 2 single quotes apparently. I forgot to do it in both places, I had a single \ in the second place!

like image 111
jamesbascle Avatar answered Sep 18 '22 09:09

jamesbascle