Solved

import from excel in db2

Posted on 2006-06-27
5
803 Views
Last Modified: 2008-02-01
I have some data in excel(csv) ; the sequence of data in excel matches the sequence of data in table
I need to import the data in db2 what wil be the bext way to do it

Thankyou!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
0
Comment
Question by:royalcyber
5 Comments
 
LVL 50

Expert Comment

by:Lowfatspread
ID: 16999100
Hi royalcyber,
use a LOAD statement probably with the delimted format....

which OS/Environment/Version of UDB/Db2 are you using?

Cheers!
0
 
LVL 45

Expert Comment

by:Kdo
ID: 17000101
Hi RoyalCyber,

If you've got some odd formatting issues (like dates) you might find it easier to use Micro$oft Access to link to the csv file and export it to DB2.


Kent
0
 
LVL 13

Expert Comment

by:ghp7000
ID: 17000927
if you could post one line of the csv file then it would be easier to tell you how to approach this problem
0
 

Author Comment

by:royalcyber
ID: 17001197
coursecode,jrsscode,exitlevel,date,lastupdatedby

az101,Q301212,1,09/02/2006,tom



i have 10,000 records in the file
0
 
LVL 13

Accepted Solution

by:
ghp7000 earned 500 total points
ID: 17009338
with 10k records you could use import or load, import if you dont want to impose exclusive locks on the table, load if speed is more important and you can load the data without worrying about concurrent access.
As for the method, its quite straightforward
db2 import from filename insert into tablename
your table must be definded as follows:
col1 char or varchar
col2 char of varchar
col3 smallint or int
col4 date
col5 char or varchar
if the table has primary key or index, some records may not be loaded or imported
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

708 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

13 Experts available now in Live!

Get 1:1 Help Now