Re: How to concatenate two lines of result from sqlplus

From: Michel Cadot <micadot{at}altern{dot}org>
Date: Mon, 6 Nov 2006 07:58:31 +0100
Message-ID: <454edd17$0$31569$426a74cc_at_news.free.fr>


"lovecreatesbea..._at_gmail.com" <lovecreatesbeauty_at_gmail.com> a écrit dans le message de news: 1162794135.333120.32910_at_b28g2000cwb.googlegroups.com...
| Suppose I have a table named USER as below,
|
| TABLE: USER
|
| USER_NAME NUMBER ADDRESS
| =============================================
| dennis ritchie 123456 att bell lab
| ken thomas 234567 att bell lab
|
| I select the content in korn shell as following:
|
| #...
|
| sqlplus -silent ""$user"/"$pass"_at_"$db_ins"" <<-EOF
| set feed off
| set heading off
| spool $output # variables assigned somewhere already
|
| select USER_NAME, NUMBER, ADDRESS
| from USER
|
| spool off
| exit
| EOF
|
| #...
|
| My question is, I get the result in the $output file as,
|
| dennis ritchie
|
| 123456 att bell lab
|
| How can I concatenate two lines above? Or how can I place the line
| 123456 att bell lab after dennis ritchie?
|

Format your columns (statement "column") Set your linesize to a big value (statement "set linesize") Trim your output (statements "set trimout on", "set trimspool on")

Regards
Michel Cadot Received on Mon Nov 06 2006 - 07:58:31 CET

Original text of this message