Skip to content
Advertisement

How to concatenate strings wrapped around the ‘ character

I would like to concatenate 2 strings/fields from a table into one additional attribute and have it wrapped around the “ ‘ ” character using an sql select statement in oracle.

This statement

produces

1

valid code but not what I want

2

Error report – ORA-01722: número inválido

3 Error

SQL Error: ORA-00936: falta expressão 00936. 00000 – “missing expression”

I want the code to produce:

Advertisement

Answer

You need to concatenate '''' at the start and at the end of the concatenated columns:

See the demo.
Result:

If there are really double quotes in the columns and you want them removed:

See the demo.
Result:

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement