Solved

Automate Import of Text File Into DB2

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

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 24

Expert Comment

by:Tomas Helgi Johannsson
ID: 21791963
0
 
LVL 24

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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 (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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

757 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

20 Experts available now in Live!

Get 1:1 Help Now