How to add line breaks in a request (Informix)?

I need to make a query that updates text with line breaks. I tried using \n but literally inserted "\ n".

Example:

 update table set text = "first line\nsecond line" 

I want it to display this text as:

 "first line second line" 

not like "first line\nsecond line" .

When I do this with .NET, it works, but not on the stored procedure.

Does anyone know how to do this?

+4
source share
3 answers

Perhaps you can look for ifx_allow_newline 'function.

Alternatively, following the OMG Ponies suggestion, you can search for the ' ascii ' package from the IIUG software archive. Informix now has the ASCII () and CHR () functions built-in. Please note that if you have older versions of Informix (nothing until 11.50 - 11.70 for CHR() ), these functions will not be available, and you will need to consider the package from the IIUG archive.

+5
source

To use the newline character inside SP:

 (...) EXECUTE PROCEDURE IFX_ALLOW_NEWLINE('T'); SELECT FIRST 1 REPLACE('Lets use a breakline here#and here#for example', '#', ' ') FROM systables; (...) 
+4
source
 SELECT 'Wibble' + CHAR(13) + CHAR(10) + 'Wobble' 

Inserts a carriage return and a new line of type \ r \ n in C #. You may need both, if the text will ever be exported to the document somewhere, because sometimes just a new line - \ n char (10) - appears as a window symbol for some very gloomy reason that I forgot / never received :-)

0
source

Source: https://habr.com/ru/post/1302267/


All Articles