Re: SQLPlus output format
Date: Tue, 18 May 1993 19:13:46 GMT
Message-ID: <C78LEy.EKy_at_panix.com>
In <1t7st1$1a1_at_spock.dis.cccd.edu> paulk_at_spock.dis.cccd.edu (Paul Krikorian) writes:
>Hi, could anybody tell me if it is possible to get SQLPlus to display
>the result of a SELECT statement in the following format:
>column_1 = value
>column_2 = value
>.
>.
>.
>column_n = value
Yes, this can be done. First, issue the following two SQL*Plus commands:
set head off column V newline
The first suppresses the display of column headings, the second defines a column called "V" that will print as a newline. (If your table has a column called V, use a different name.
Then issue your select statement in the following format:
select 'column_1 = '||column_1, '' V,
'column_2 = '||column_2, '' V,
. . . 'column_n = '||column_n, '' V
from mytable;
You'll have to play with this a little to get the output aligned correctly, but it should give you more or less what you want. Oh yes, use the to_char() function to convert any non-char column values since you're concatenating them with a char string.
Eva Blinder
eblinder_at_panix.com
Received on Tue May 18 1993 - 21:13:46 CEST