Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003

    Unanswered: Problem with newline character

    Hello Friends ,

    I am getting a problem with newline character in Oracle.

    Fronend : Oracle 9i Forms . In this there are certain text boxes where user can press return key, which generates newline character. For e.g there is a field -> Person Status reason. Users generally enter Alive followed with return key.

    Due to this in database field this newline character also gets entered. The problem is –

    1) I can’t determine which rows are affected. Any Oracle function or command, which can tell me this field, has enter character.

    The major problem occurs when data is replicated to Warehouse. Spool file is generated for all updated rows but this file gets corrupted as the newline character divides 1 line in 2 lines.

    How can I determine /n (Enter) character I my field.

    What can I use in my code so that newline character is omitted before entering.

  2. #2
    Join Date
    Jun 2003
    West Palm Beach, FL


    Did you try the REPLACE() and/or INSTR() functions?

    Hint: Search for either CHR(10) or CHR(13).

    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  3. #3
    Join Date
    Dec 2003
    If you use regexp_replace() (10g only), you can get rid of all control characters:

    SQL> create table t (f varchar2(10));
    Table created.
    SQL> insert into t values ('hi'||Chr(10)||Chr(13));
    1 row created.
    SQL> select '~'||f||'~' from t;
    SQL> update t
      2  set f = regexp_replace(f,'[[:cntrl:]]',null);
    1 row updated.
    SQL> select '~'||f||'~' from t;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts