If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > CLP - cannot get the select query to write to a file

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-03-10, 09:28
Howardw Howardw is offline
Registered User
 
Join Date: Nov 2009
Posts: 18
CLP - cannot get the select query to write to a file

Using db2 9.7 on windows vista

I have tried numerous ways to get the SQL output to a file

on db2 prompt=>!db2 select * from table >l:db2\sql.txt

in the file sql.txt i get
SQL1024N A database connection does not exist. SQLSTATE=08003

I have run the connect to database command and got the database connect information details

if i do
select * from table >l:db2\sql.txt

then the CLP gives the mesage "the command was processed as an sql statement etc"

What do i need to do to get the CLP to send the SQL output to the file ?

I would like to see the table data in the file from the select statement

Thanks
Reply With Quote
  #2 (permalink)  
Old 02-03-10, 09:43
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Look at the "UPDATE COMMAND OPTIONS" CLP command in the manual.

Andy
Reply With Quote
  #3 (permalink)  
Old 02-04-10, 11:57
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
do not use the command prompt - use command window - there all rerout can be used
> outfile
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On