Solved

Automate Import of Text File Into DB2

Posted on 2008-06-13
3
768 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How can I tweak this SQL to perform DB2 update rather than listing 17 304
Tricky SQL question 13 388
DB2 V8.02 and Oracle security audit information 12 291
Access to SYSIBM tables 7 97
November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
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…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

920 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now