?
Solved

Automate Import of Text File Into DB2

Posted on 2008-06-13
3
Medium Priority
?
805 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 26

Accepted Solution

by:
Tomas Helgi Johannsson earned 2000 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 26

Assisted Solution

by:Tomas Helgi Johannsson
Tomas Helgi Johannsson earned 2000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

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…
Screencast - Getting to Know the Pipeline
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month17 days, 6 hours left to enroll

864 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