db2 session output ?

Jay Huffman

db2 session output ?
All -
AIX machine -
I have googled and db2 help to no avail -
I am in a db2 session, at the db2 prompt,
and I want to accomplish the following,
a query and the output to a file
db2=> select count(*) from syscat.tables > myfile.txt
this will fail - any help with syntax.
also from a db2 prompt, execute a file that contains valid sql statement(s)
file: test1.sql
select count(*) from syscat.tables;
db2 => @test1.sql
db2 => !test1.sql
both will fail - any help with syntax ??

Thanks for your assistance,
*** Jay Huffman
*** "Learn All That Is Learnable"

Welcome to the DB2 User Group - Central Pennsylvania list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/DB2-UG-Central-PA.html. From that page select "Join or Leave the list". The IDUG Listserv FAQ is at http://www.idugdb2-l.org. The DB2 User Group - Central PA List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm