Informix

nested-group-icon.png

DB2

Expand all | Collapse all

ALLOW_NEWLINE

  • 1.  ALLOW_NEWLINE

    Posted Mon November 23, 2020 10:00 AM
    Hi.
    I'm on 14.10.FC4W1.
    I have ALLOW_NEWLINE set to 1 in my onconfig file.
    But after I execute
    execute procedure ifx_allow_newline('f');
    I still can insert strings with new line chars. Is this the expected behaviour?
    This runs without an error:


    drop procedure if exists check_nl();
    create procedure check_nl() returns varchar(255);
    define s varchar(255);
    let s = "String with "||chr(10)|| " a newline";
    create temp table tt (a varchar(255));
    insert into tt values(s);
    execute procedure ifx_allow_newline('f');
    insert into tt values(s);
    return s;
    end procedure;

    Thanks in advance,
    -Snorri

    ------------------------------
    Snorri Bergmann
    ------------------------------


  • 2.  RE: ALLOW_NEWLINE

    Posted Tue November 24, 2020 02:36 AM

    This parameter is only for the syntax check of the parser.

    Example:

    execute procedure ifx_allow_newline('t');

    select "This is a test for
           NEWLINE"

    from systables where tabid = 1;

    (constant)
    This is a test for
          NEWLINE
    1 row(s) retrieved.

    execute procedure ifx_allow_newline('f');

    select "This is a test for
           NEWLINE"

    from systables where tabid = 1;

      282: Found a quote for which there is no matching quote.

    Error in line 4

    Newr character position 8



    ------------------------------
    Gerd Kaluzinski
    ------------------------------



  • 3.  RE: ALLOW_NEWLINE

    Posted Wed November 25, 2020 11:25 AM
    Thanks Gerd.
    The manual was not too clear on this IMO.

    Regs,
    -Snorri

    ------------------------------
    Snorri Bergmann
    ------------------------------