Input and output files  Chapter 3: Using Interactive SQL in Graphics Mode

Chapter 2: Using Interactive isql from the Command Line

UNIX command-line redirection

The UNIX redirection symbols, “ <” and “>”, provide a similar mechanism to the -i and -o options, as follows:

isql -Usa < input > output

You can direct isql to take input from the terminal, as shown in this example:

isql -Usa -Ppassword -Sserver_name << EOF > output
use pubs2
go
select * from table
go
EOF

“<<EOF” instructs isql to take input from the terminal up to the string “EOF.” You can replace “EOF” with any character string. Similarly, the following example signals the end of input with Ctrl-d:

isql -Usa << > output




Copyright © 2005. Sybase Inc. All rights reserved. Chapter 3: Using Interactive SQL in Graphics Mode

View this book as PDF