'How to handle French character in Oracle insert statement [duplicate]

Insert into mytable (English_Name, French_Name)
Values('Contact Center', 'Centre d'appels')

This would not work since the special French Character d'.

Could someone help me?



Solution 1:[1]

The problem is caused by the single-quote character, since single-quote has special meaning - it is used to indicate the beginning and the end of a hard-coded text literal.

Simplest: you need to use TWO single-quote characters to generate one such character in the output (in this case: in the value stored in the table).

Cleaner: Use the q-quote mechanism (google for the term, if you had not heard of it before). Like this:

insert ... values ( ... , q'[Centre d'appels]')

Notice q'[ for opening and ]' for closing the text literal.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 mathguy