Solved

Automate Import of Text File Into DB2

Posted on 2008-06-13
3
776 Views
Last Modified: 2008-06-16
Hello,
I need to automate a twice daily text file into a DB2 database.
What would be the best way to accomplish this.
I could have the file FTP'd to a directory where the database could get to it. I don't know where to go from there and my experience is with SQL Server. Is there some analog to DTS in DB2?
0
Comment
Question by:stopher2475
  • 3
3 Comments
 
LVL 25

Accepted Solution

by:
Tomas Helgi Johannsson earned 500 total points
ID: 21791949
  Hi!

Yes you should do a simple LOAD of the files into a table by simply executeing

db2 "load from 'testfile' of del insert into workemployee"

and you probably have to put the full path to the file inside the single quotation mark.
What version of DB2 are you using and on what OS ?

Regards,
   Tomas Helgi
0
 
LVL 25

Expert Comment

by:Tomas Helgi Johannsson
ID: 21791963
0
 
LVL 25

Assisted Solution

by:Tomas Helgi Johannsson
Tomas Helgi Johannsson earned 500 total points
ID: 21792010
If you are using DB2 on Linux or Windows you could alwas generate
a scheduled task (cronjob on Linux) which checks if the file is in the directory and loads the file into
the table if it exists and the db2 command for that is the command I described in my first comment.

Regards,
   Tomas Helgi
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question