Re: Selecting '/n' in query
Date: 1995/05/24
Message-ID: <3ptv7j$qmt_at_mp.canuck.com>#1/1
tim.wyles_at_nt.com (Tim Wyles) wrote:
>I'm having difficulty in selecting a newline value in a query. Using a
>simple example, I wish to use something to like
> select sysdate, ??????, sysdate from dual;
>with the result that each sysdate is on a newline, directly under the
>other. What should I put in place of ?????? ?
Are you using SQL*Plus? If so, look at some of the options to the COLUMN command. FOLD_BEFORE and FOLD_AFTER cause line breaks before or after the column. Note that both of these require a number as a parameter, although the value of that number is ignored. See the online help for the column command:
HELP COLUMN
If you do not get several screens worth of output, ask you sys admin
to load help. It is located (I think) at
$ORACLE_HOME/plus31/admin/help
or somewhere near there. It has a script to create tables and uses
sqlload to populate them. Another script indexes the help. Its a lot
cheaper than getting every user a manual set. Some useful things to
try are HELP TOPICS and HELP COMMANDS.
SQL> COLUMN a FOLD_AFTER 1
SQL> SELECT sysdate a, sysdate FROM dual;
gives
SYSDATE
SYSDATE
95-MAY-20
95-MAY-20 I.E., you get the headers split as well as query result lines.
One thing to watch out for: normally the help data will correspond to the server you are connected to, so you may get help for a different version of SQL*Plus that the one you are using.
-- Doug Henderson, Glen Coulee Consulting, Calgary, Alberta [Sent by Free Agent 0.55]Received on Wed May 24 1995 - 00:00:00 CEST