IFX_ALLOW_NEWLINE Function

The IFX_ALLOW_NEWLINE function sets a newline mode that allows newline characters in quoted strings or disallows newline characters in quoted strings within the current session.

The IFX_ALLOW_NEWLINE function has the following syntax.
IFX_ALLOW_NEWLINE Function

1  IFX_ALLOW_NEWLINE  (
2.1  ' t '
2.1  ' f '
1 )

If you enter 't' as the argument of this function, you enable newline characters in quoted strings in the session. If you enter 'f' as the argument, you disallow newline characters in quoted strings in the session.

You can set the newline mode for all sessions by setting the ALLOW_NEWLINE parameter in the ONCONFIG file to a value of 0 (newline characters not allowed) or to a value of 1 (newline characters allowed). If you do not set this configuration parameter, the default value is 0. Each time you start a session, the new session inherits the newline mode set in the ONCONFIG file. To change the newline mode for the session, execute the IFX_ALLOW_NEWLINE function. Once you have set the newline mode for a session, the mode remains in effect until the end of the session or until you execute the IFX_ALLOW_NEWLINE function again within the session.

In the following example, assume that you did not specify any value for the ALLOW_NEWLINE parameter in the ONCONFIG file, so, by default, newline characters are not allowed in quoted strings in any session. After you start a new session, you can enable newline characters in quoted strings in that session by executing the IFX_ALLOW_NEWLINE function:
EXECUTE PROCEDURE IFX_ALLOW_NEWLINE('t');

In ESQL/C, the newline mode that is set by the ALLOW_NEWLINE parameter in the ONCONFIG file or by the execution of the IFX_ALLOW_NEWLINE function in a session applies only to quoted-string literals in SQL statements. The newline mode does not apply to quoted strings contained in host variables in SQL statements. Host variables can contain newline characters within string data regardless of the newline mode currently in effect.

For example, you can use a host variable to insert data that contains newline characters into a column even if the ALLOW_NEWLINE parameter in the ONCONFIG file is set to 0.

For further information on how the IFX_ALLOW_NEWLINE function affects quoted strings, see Quoted String. For further information on the ALLOW_NEWLINE parameter in the ONCONFIG file, see the HCL OneDB™ Administrator's Reference.