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 > Script Batch to make a select command

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-26-06, 09:25
carlojil carlojil is offline
Registered User
 
Join Date: Jan 2006
Posts: 2
Script Batch to make a select command

Hi,

i'd like create by a batch file a king of query, for example :

select "filed A" from "Table1" where "filed A" = 'Pippo' > filelog.log


Is it possible ?
Reply With Quote
  #2 (permalink)  
Old 01-26-06, 16:52
dollar489 dollar489 is offline
Registered User
 
Join Date: Sep 2002
Posts: 456
Yes, it is possible!
Reply With Quote
  #3 (permalink)  
Old 01-27-06, 03:06
przytula przytula is offline
Registered User
 
Join Date: Nov 2004
Posts: 374
batch

or you can execute directly
db2 "select .... > filename
or create a file with the sql statements and execute it with
db2 -tvf filename > filename_out
specifying -x would remove the headers and trailer (just keeping data)
__________________
Best Regards, Guy Przytula
DB2/ORA/SQL Services
DB2 DBA & Advanced DBA Certified
DB2 Dprop Certified
http://users.skynet.be/przytula/dbss.html
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