Line break within a MYSQL query

0

Hello, can anyone help me with line breaks within a mysql query?

The code looks like this:

CONCAT('Origem -> ',vEnderecoOrigem,' \r\nDestino ->',vEnderecoDestino)

The result:

Origem -> Rua Exemplo Origem Destino -> Rua Exemplo Destino

Expected result:

Origem -> Rua Exemplo Origem 
Destino -> Rua Exemplo Destino

I've tried CHAR(10),(13),\n and I can not get the expected result. Is it possible to do this?

and .xls , the name is FPDF .

    
asked by anonymous 17.05.2018 / 23:01

2 answers

0

Actually the problem was not in the query but in the application. I found the solution on the FPDF website using a MultiCell , this function already creates a cell and breaks the lines depending on the size of the string. Thanks for the help!

    
18.05.2018 / 21:08
1

You can use CONCAT_WS , you should resolve the problem:

CONCAT_WS('\n', 'Origem -> '.vEnderecoOrigem, 'Destino ->'.vEnderecoDestino)
    
18.05.2018 / 16:45