p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Oracle (http://p2p.wrox.com/forumdisplay.php?f=105)
-   -   New line in concatenated field (http://p2p.wrox.com/showthread.php?t=1371)

NK July 8th, 2003 01:21 AM

New line in concatenated field
 
HI
I have a query which populates a field by concatenating few other fields. For each field concatenated, the value should be displayed in a new line.

An example
SELECT 'INSERT INTO Table1(
Title) values
(''Name: ' + ForeName + ' Surname: ' + SurName + ' Title: ' + Title +);'
FROM Table2
This returns
INSERT INTO Table1 (title) values (Name: XX SurName: YY Title: ZZ)

Is there a way enough space is created between each concatenated field so that they get displayed in new lines
Name: XX
SurName: YY
Title: ZZ

rather than Name: XX SurName: YY Title: ZZ

Char (13) does not seem to help.

Thanks
Nimisha


melocy July 15th, 2003 10:27 PM

Please Type chr(10)

scott@PRD.COM> select 'Name:XX'||chr(10)||'SurName:YY'||chr(10)||'Title: ZZ' aa from dual ;
AA
------------------------------------------------------
Name:XX
SurName:YY
Title:ZZ




All times are GMT -4. The time now is 02:21 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.