Re: put carriage return into VARCHAR2 using PL/SQL

From: Scott Urman <surman_at_dlsun338.us.oracle.com>
Date: 1996/09/06
Message-ID: <50ple4$fgj_at_inet-nntp-gw-1.us.oracle.com>#1/1


In article <x6eloeng4ue.fsf_at_mdt26awm.i-have-a-misconfigured-system-so-shoot-me>, Ming-Ding Tsao <mtsao_at_cas.org> writes:
|>
|> Question: In R7.3.2 using PL/SQL how to put the carriage return(0x0d
|> or 0x0a) into a string ?
|>
|>
|> For example:
|>
|> achar VARCHAR2(16);
|>
|> achar := 'test' || ' ' || 'line' || ' ';
|>
|> -- how to put a line feed to replace the last ' ' above.
|>

Use the CHR function. CHR(10) is a line feed in most character sets.

|>
|> In PL/SQL documentation it states character literals include all the
|> printable characters in the PL/SQL character sets, and the character
|> set include "tabs, spaces, and carriage returns". I noticed that
|> functions are used to produce a line feed such as dbms_output.newline or it
|> is done implicitly in side a function such as put_line().
|>
|> Thanks, Ming Tsao
|>
|> --



Scott Urman Oracle Corporation surman_at_us.oracle.com

Author of _Oracle PL/SQL Programming_ ISBN 0-07-882176-2 Published by Oracle Press - http://www.osborne.com/oracle/index.htm

"The opinions expressed here are my own, and are not necessarily that of  Oracle Corporation"
Received on Fri Sep 06 1996 - 00:00:00 CEST

Original text of this message