Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: help newbie fromatted ASCII text into cell
myfam_at_surfeu.fi (Andrew) wrote in message news:<c5826e91.0409202045.54348112_at_posting.google.com>...
> Hi,
> how do I insert formatted ASCII text like this
>
> [start]
> host=a.b.c # host name
> port=123 # port
> increment=1^2 # increment
> [end]
>
> into a VARCHAR2 cell. My problem is
> a. end of lines (appending ||chr(13) seems to help)
> b. spaces in each should be retained
>
>
> Thanks,
> Andrew
Hi Andrew,
I hope the following example helps:
create table test_table (os varchar2(15),
connection varchar2(200))
insert into test_table (os,connection)
values ('unix', 'host=a.b.c # host name' || chr(10) || 'port=123 # port' || chr(10) || 'increment=1^2 # increment')
insert into test_table (os,connection)
values ('windows', 'host=a.b.c # host name' || chr(13) || chr(10) || 'port=123 # port' || chr(13) || chr(10) || 'increment=1^2 # increment')
declare
cursor c is select os,
connection from test_table;
for c_rec in c loop
dbms_output.put_line('----------------------------------------'); dbms_output.put_line(upper(c_rec.os)); dbms_output.put_line(c_rec.connection);end loop;
![]() |
![]() |