Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

lost spaces while inserting multiline string

Mustafa KALAYCIAug 31 2021 — edited Aug 31 2021

Hi,
I am about to loose my mind! for so many years I am working with Oracle and I am not sure if this is something unknown to me! here is a sample code:

create table t1 (d varchar2(800));
begin
delete t1;
insert into t1 values (
'abc
  
qwe');
end;
/

there is a string with 3 lines that I wanted to insert. second row contains 3 space character but after inserting data when I select the table spaces are gone! result is:

abc

qwe

there is nothing at second line. I tried this on 19.8 and 19.12 databases and used both sql develoepr and sqlplus. Also tried at livesql but livesql and it worked! Can anyone help me with this. I also used single insert statements instead of begin end block. same result.
edit: I couldn't find how to use a format tag for my sql codes by the way.

This post has been answered by Jan Gorkow on Aug 31 2021
Jump to Answer
Comments
Post Details
Added on Aug 31 2021
7 comments
1,713 views