Results 1 to 2 of 2
  1. #1
    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!

  2. #2
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •