How to insert a Enter Key (a new line) into a string in Oracle 10g?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • islandfong
    New Member
    • Aug 2006
    • 15

    How to insert a Enter Key (a new line) into a string in Oracle 10g?

    Hi,

    I am trying to insert / append a Enter Key into a string so to achieve the effect as following:

    Address:
    4 Hollawood Road,
    USA 123456

    Some ppl recommended to use chr(10) or chr(13), however it did not seem to work after i tried as following statements.
    SELECT 'abc' || chr(10) || 'def' AS TestStr FROM DUAL;
    or
    SELECT 'abc' || chr(13) || 'def' AS TestStr FROM DUAL;
    Any body has any idea on this?
    Thanks.
  • sushma
    New Member
    • Dec 2006
    • 4

    #2
    hi,


    SQL> SELECT 'ABC'|| CHR(10)||'DEF' as test from dual;

    TEST
    -------
    ABC
    DEF

    It worked for me. try it out i think this is the right procedure.

    Comment

    • islandfong
      New Member
      • Aug 2006
      • 15

      #3
      Hi,

      Really thanks for your reply. I also tried in a procedure and it works there. Seems like I am not able to see the proper result from the SQL Editor.

      Comment

      Working...