IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

^ delimeter after every col in db2 select


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kishpra

New User


Joined: 24 May 2010
Posts: 92
Location: Pune

PostPosted: Wed Mar 12, 2014 3:17 pm
Reply with quote

Hi,

I need the below -

col1^col2^col3^

Select col1,col2,col3
from tab1


Thanks,
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Mar 12, 2014 7:52 pm
Reply with quote

Hello,

Try
Code:
SELECT COL1, '^',
            COL2, '^;,
            col3,'^'
  from tab1;
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Wed Mar 12, 2014 8:07 pm
Reply with quote

If all the three columns are of datatype char

You could try
Code:

SELECT COL1||'^'||COL2||'^'||COL3||'^'  FROM TABL1;
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Dynamically pass table name to a sele... DB2 2
No new posts SELECT from data change table DB2 5
No new posts Select two different counts from SQL... DB2 6
No new posts Select a DB2 value in a specific deci... DB2 4
No new posts How can I select certain file dependi... JCL & VSAM 12
Search our Forums:

Back to Top