If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Formatting the output to single line

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Jul 2004
Posts: 13
Formatting the output to single line

Hi

Today I searched all over internet and also several forums including this, but couldn't find my answer! Can you please help me out?

How can I modify the output of my query in informix into one row only.

Here's the example:

Query:
select NAME from EMPLOYEE

Output:
James
Peter
John
Stephen
Gary

I want to make the output to:

James Peter John Stephen Gary

Is it at all possible in informix? If yes - how? If not I will go for unload and manipulation with script.

Your help would be greatly appreciated.

Thanks!
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: Jun 2009
Location: Lisboa, Portugal
Posts: 77
Hi,

If you are using Linux and the distribution has de paste command do:

dbacess <<EOF
database name_of_bd;
unload to "name_file.out" select NAME from EMPLOYEE;
EOF
paste -s -d ' ' name_file.out > new_paste_file.out

Have fun.
__________________
LS
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On