Rotem87
Rotem87

Reputation: 105

Assign ' in string

I have the following value that needs to be assign into string -

ABC'DEFGH

How I can assign the sign of ' into string? example -

str := 'ABC'DEFGH' 

Upvotes: 0

Views: 56

Answers (2)

Boneist
Boneist

Reputation: 23578

You could also use the quoted string: q'<delimiter character><string<closing delimiter character>', e.g.:

str := q'{ABC'DEFGH}'

You can use a variety of characters as the quote delimiters. For more information, see the documentation for information on text literals, which includes how to use the q operator.

Upvotes: 4

user330315
user330315

Reputation:

It's the same as with plain SQL: to escape a single quote, double it.

str := 'ABC''DEFGH';

Upvotes: 4

Related Questions