Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to insert multi line message into long datatype

Status
Not open for further replies.

damonpin

Technical User
Oct 27, 2002
2
HK
Hi
My company has an old oracle database table which use long datatype to store short news article. I need to insert a few short article into that table. However in sqlplus when I tried :

create table article ( id int, text long, ....);

insert into article (id, text, ...) values (407,
' Our company has launch new version of award winning CRM software crm-gold. ...................... please refer to our press release for detail')

SQLPLUS seems dosen't understand this is multiline message and complain it is not a valid value. What is the right way to insert multi line message into long? I can't change the datatype because that will break the application.

Thanks a lot for your help

Damon Pin
 
I was able to do the following via SQLPlus:

14:59:09 SQL> create table test(text long);
Table created.

15:03:38 SQL> insert into test values(' Our company has launch new version of award winning CRM software crm-gold. ....................
.. please refer to our press release for detail');

1 row created.

How are you entering a multiline piece of data?
 
If you need "more readable" statement, you may concatenate smaller piaces:

insert into article (id, text, ...) values (407,
' Our company has launch new version '
||'of award winning'
||' CRM software crm-gold.'
||' ......................'
||' please refer to our press release for detail')



 
If you want new lines, try concatenating CHR(13)||CHR(10) at the appropriate places.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top