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: Running a query from remote Comp and saving results

Re: Running a query from remote Comp and saving results

From: Just Fred <fpuhan_at_excite.com>
Date: Wed, 05 Oct 2005 21:49:34 -0400
Message-ID: <434482ae$1@news101.his.com>


harishkasuganti_at_gmail.com wrote:
> Hi,
> I need to run a simple select query from my desktop and save the
> results in a text file on my desktop. I am planning on setting it up as
> a scheduled task in windows.
>
> I tried using the following
> echo exec dbms_output.putline(desc campaign_0_A) >> C:\test.txt; |
> sqlplus username/pwd_at_DBSERVER
>
> But, it puts out the text 'desc campaign_0_A' in the output file
> test.txt. Can I use dmbs_output command to do this? Or something else?
>
> any suggestion greatly appreciated.
>
> TIA
>

I may be missing something here. If so, I apologize.

Why not use a simple 'spool' statement to spool output to disk?

e.g.:

@echo off
rem example to spool output to local disk sqlplus username/pwd_at_DBSERVER
set pagesize 66 linesize 128 feedback off verify off termout off spool c:\mydir\output.txt
select

   ...
from

   ...
where

   ...
/
spool off
exit
[EOF] Received on Wed Oct 05 2005 - 20:49:34 CDT

Original text of this message

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