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: Difficult SQL Please Help

Re: Difficult SQL Please Help

From: Walter Dnes <waltdnes_at_waltdnes.org>
Date: Tue, 22 Feb 2000 00:53:27 -0500
Message-ID: <kh74bs8cujshg8flpfpentl4msjc5ik1uc@4ax.com>


On Sun, 20 Feb 2000 17:23:28 GMT,
"Sean Harasin" <sharasin_at_mbakercorp.com> wrote in article <kqVr4.46$RE2.327756_at_dca1-nnrp1.news.digex.net>:

  Here's a back-door self-modifying/self-writing-program approach. The "pure-programming-police" will probably yell and scream about about this, but it works, and *GREATLY* speeds up what would normally be a correlated query, because the

SET ECHO      OFF;
SET FEEDBACK  OFF;
SET HEADING   OFF;

SET NEWPAGE 0;
SET PAGESIZE 0;
SET TERMOUT   ON;
SET TRIMOUT   ON;
SET TRIMSPOOL ON;

SET VERIFY OFF;
-- IMPORTANT;

SPOOL PART2.SQL;
-- Now why am I spooling to another .SQL file?;
SELECT 'SELECT';
SELECT '      READING_DATE AS READ_DATE,';
SELECT '      MIN(reading_time) AS READ_TIME,';

-- Note the doubled single quotes;
SELECT ' SUM(DECODE(INSTRUMENT_NAME, ''P001'', (';

-- IMPORTANT(Again);

<Run whatever query it is that produces the result 3.92>

SELECT ' / ((DECODE(HEADWATER -';
SELECT ' TAILWATER, 0, NULL,(HEADWATER-TAILWATER))) / 100)))) AS "P001 DELTA_HEAD",'; ...
etc, etc, for the rest of your code;
remember to double up single quotes
once you finish quoting the code...
SPOOL OFF;
@PART2
--

Walter Dnes <waltdnes@waltdnes.org> http://www.waltdnes.org SpamDunk Project procmail spamfilters.
A picture is worth a thousand words; unfortunately, it consumes the bandwidth of ten thousand words. Received on Mon Feb 21 2000 - 23:53:27 CST

Original text of this message

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