SQL Spool equivalent command in DOS

 
Thread Tools Search this Thread
Special Forums Windows & DOS: Issues & Discussions SQL Spool equivalent command in DOS
# 1  
Old 01-17-2006
Question SQL Spool equivalent command in DOS

This question maybe in the wrong category but I'm posting here due to urgency.
In DOS is there a command to perform a similar function to spool command in SQL or Script command in UNIX?
I want to print all command line output to a file but I don't want to use the echo command for each line.

Any help will be appreciated.

Steve
# 2  
Old 01-17-2006
I have moved this to the appropriate forum.

The easiest way to achieve this would be to put all your commands into a batch file, and then redirect the output.

Code:
C:\putty>type foo.bat
echo "this is my batch file"
dir

C:\putty>foo.bat > foo.out 2>&1

C:\putty>type foo.out

C:\putty>echo "this is my batch file"
"this is my batch file"

C:\putty>dir
 Volume in drive C is SYSTEM
 Volume Serial Number is E032-0520

 Directory of C:\putty

17/01/2006  22:36    <DIR>          .
17/01/2006  22:36    <DIR>          ..
17/01/2006  22:34                36 foo.bat
17/01/2006  22:36                 0 foo.out
18/09/2005  03:03           131,072 pageant.exe
18/09/2005  03:03           266,240 plink.exe
18/09/2005  03:03           286,720 pscp.exe
18/09/2005  03:03           286,720 psftp.exe
18/09/2005  01:30            29,267 putty.cnt
18/09/2005  03:03           430,080 putty.exe
18/09/2005  01:30           595,500 putty.hlp
18/09/2005  03:03           167,936 puttygen.exe
              10 File(s)      2,193,571 bytes
               2 Dir(s)  24,182,276,096 bytes free

Yes... UNIX-style redirection works in "cmd" Smilie

Cheers
ZB
# 3  
Old 01-17-2006
Bug

Thanks zazzybob!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Append date to sql*plus spool (log) file in shell script

SQL*Plus version : 11.2.0.4 OS : Oracle Linux 6.5 SQL*Plus is a client application to connect to oracle database. The log file for this tool is generated via spool command as shown below. I am trying to append date ( $dateString ) to spool file as shown below. $ cat test2.sh #!/bin/bash... (4 Replies)
Discussion started by: kraljic
4 Replies

2. Windows & DOS: Issues & Discussions

DOS Equivalent of UNIX Command

Hi, The title of this post is a little vague but I couldn't think of what to call it. In Unix you can perform the following command ftp -v IPADDRESS <<END put FILE END In a DOS command prompt, is it possible to do the same kind of thing that the "<<END" does? So for example, ... (4 Replies)
Discussion started by: Ste_Moore01
4 Replies

3. Shell Programming and Scripting

SQL*PLUS Spool Output

Hi, Im writing a script to run a bit of sql(via sqlplus) that pulls back some data and spools it to a file, I want the spool file to only display the data, with no sql command at the top and no reports at the bottom ie(# of records recieved). I am currently doing it via a grep command but... (1 Reply)
Discussion started by: Magezy
1 Replies

4. Shell Programming and Scripting

UNIX/SQL loop to spool files!!

I want to spool files from unix using a sql script that would take values from another sql query within the KSH script.. unix loop select order_date from date_tbl for each order_Date i need to call this spool script with the value sqlplus scott/tiger@order_db @/ordspool/order_date.sql... (2 Replies)
Discussion started by: vr23
2 Replies

5. Shell Programming and Scripting

Passing filename dynamically in SPOOL of SQL*PLUS in shell script

Hi all, I am executing shell script in which I am using SQLLDR In this SQLLDR I am passing text file having PL/SQL script. This script will produce some formated output, this output I have to spool in another text file. Currently I have given this in script file as following Spool... (2 Replies)
Discussion started by: shekharjchandra
2 Replies

6. Windows & DOS: Issues & Discussions

dos/intel unix command equivalent

In Unix I can use command line to do a find for files older than so many days and remove them. I can also capture the date to see if its a saturday and do something different. Are there any dos/intel command line equivalent commands to do this on a windows 2003 server? This is from an... (6 Replies)
Discussion started by: MizzGail
6 Replies

7. Windows & DOS: Issues & Discussions

what is the DOS equivalent of alias command?

how do we create aliases to commands in dos? thanks (9 Replies)
Discussion started by: milhan
9 Replies

8. Programming

Single sql query to spool to multiple files

Is there anyway to spool my select statement into spool files of max 10000 records each? eg I have a select statement that will return 45000 records. A normal spool command will output the 45000 into just one spool file. How can I make sqlplus do this? 00001 - 10000 records --- spool... (3 Replies)
Discussion started by: Leion
3 Replies

9. UNIX for Dummies Questions & Answers

Unix equivalent of DOS set

Hi all, what is the equivalent command of the DOS set that lists all the environment variable and their values? Xavier. (3 Replies)
Discussion started by: xxavier
3 Replies

10. UNIX for Advanced & Expert Users

Command equivalent to DOS mode for SCO 5.0.6

I need to set the serial port attributes to 9600,7,E,1 in order to read and write data to it from within a Foxpro program. Unfortunately there is no function in Foxpro to set the line attributes, only open. close read and write. Stty only works on the stdout and stdin in this release, and the... (3 Replies)
Discussion started by: jgt
3 Replies
Login or Register to Ask a Question