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 > text File into db table

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-18-09, 02:18
donraja_ht donraja_ht is offline
Registered User
 
Join Date: Sep 2007
Posts: 56
text File into db table

Hello All,

Well the Heading looks like it says it all, What I would like to know is How to read/transfer coma separated data from a text file into an existing table in db2 database.Also using a command in the dos window will do.

Thanks All
Reply With Quote
  #2 (permalink)  
Old 04-18-09, 03:26
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
this page has it all
IMPORT
db2 import from xx.yy of del insert into schema.table(cols)
__________________
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
  #3 (permalink)  
Old 04-20-09, 06:46
donraja_ht donraja_ht is offline
Registered User
 
Join Date: Sep 2007
Posts: 56
Thanks prytula_guy

but me also what to know how to write in a txt file, i.e I would like to create a log file, while executing the procedure so after running some part of code in the procedure i need to write out some information on to the log file, please let me know about this i had a look with export, do you think by creating a temp table and inserting the process in this table and at the end of the procedure, use this export command to export all records to a text file,

if possible also provide me with some links to where i can find more information about this.

:-)
Reply With Quote
  #4 (permalink)  
Old 04-20-09, 11:38
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
from import you can not write to a log file, only the import messages can be saved to a message file. if custom messages are needed, try using a stored proc and write message to a file as described here
Yet Another Article on Advanced Scripting
__________________
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