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

Home -> Community -> Usenet -> c.d.o.tools -> Re: spool command doesn't work

Re: spool command doesn't work

From: Geoff Reader <grr_at_bton.ac.uk>
Date: Tue, 12 Jun 2001 13:59:22 +0100
Message-ID: <3B26122A.A085149B@bton.ac.uk>

This will run twice, once for ; zand once for /

The point was to move teh spool off until after / (or ;)

Geoff
Analyst Programmer
University of Brighton

TurkBear wrote:
>
> "Gary Dickinson" <gd_at_interchange.ubc.ca> wrote:
> This should work:( I added semi-colons)
>
> spool data;
> select to_char(strikedate,'yyyy/mm/dd hh24:mi'),
> latitude, longitude,amplitude
> from ltng_strikes
> where latitude between '&SouthLatitude' and '&NorthLatitude'
> and longitude between '&WestLongitude' and '&EastLongitude'
> and strikedate between
> to_date('&startdate 00:00', 'yyyy/mm/dd hh24:mi')
> and to_date('&enddate 23:59', 'yyyy/mm/dd hh24:mi');
> spool off;
> /
>
> Save it as somename.sql and use it in SqlPlus
> as
> @somename
>
> >Hi. I'm having problems spooling my output to a file. Here's the code i
> >have (it's a little crude but it works).
> >
> >spool data
> >select to_char(strikedate,'yyyy/mm/dd hh24:mi'),
> >latitude, longitude,amplitude
> >from ltng_strikes
> >where latitude between '&SouthLatitude' and '&NorthLatitude'
> >and longitude between '&WestLongitude' and '&EastLongitude'
> >and strikedate between
> >to_date('&startdate 00:00', 'yyyy/mm/dd hh24:mi')
> >and to_date('&enddate 23:59', 'yyyy/mm/dd hh24:mi')
> >spool off
> >/
> >
> >When I run the script, I get the error:
> >
> >ERROR at line 1:
> >ORA-00900: invalid SQL statement
> >
> >This has been stumping me. I'm a rookie at SQL. Any help would be
> >appreciated.
> >
> >Thanks
> >
> >Gary
> >
Received on Tue Jun 12 2001 - 07:59:22 CDT

Original text of this message

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