Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL*Plus problem

Re: SQL*Plus problem

From: Claire M. <cmarcoux_at_webnet.qc.ca>
Date: Wed, 06 Jan 1999 23:23:03 GMT
Message-ID: <01be39ca$589b43a0$143a0dd8@clairema>


HI!
Check in help!
In SQL+Plus
A select statement must always be done this way... Select INTO (that is a variable)
Hope its help.
Claire M.

Ed.Stevens_at_nmm.nissan-usa.com a écrit dans l'article <7707g0$rf2$1_at_nnrp1.dejanews.com>...
> Subject: SQL*Plus problem
>
> I am working on a script to run in SQL*Plus that will SELECT from a
table,
> spooling the output to create another query. It looks like this:
>
> SPOOL tmp1.sql
> SET TERMOUT OFF HEADING OFF PAGES0 VERIFY OFF ECHO OFF FEEDBACK OFF
> SELECT 'SELECT DISTINCT TO_CHAR('||COLUMN_NAME||',''DD-MON-YYYY'')'||
> ' FROM ' || OWNER ||'.' ||TABLE_NAME||
> ' ORDER BY TO_CHAR('||COLUMN_NAME||',''DD-MON-YYYY'')'||
> ';'
> FROM DBA_TAB_COLUMNS;
> SPOOL OFF;
> @tmp1.sql
>
> The problem is that the resulting SELECT DISTINCT statement can resolve
to a
> string that breaks into 2 lines when it, in turn, is processed by
SQL*Plus.
> If this line break occurs in the middle of a word, the statement is seen
to
> have syntax problems. What I would like to do is, as a part of the
literals
> that are becomeing part of the SELECT DISTINCT, insert some sort of
escape
> sequence to force a new line in the spooled output. Is there some way to
do
> this, or another way around the problem?
>
> --
> Ed Stevens
> Nissan Motor Mfg. Corp., USA
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
 

>
Received on Wed Jan 06 1999 - 17:23:03 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US