Solved

import from excel in db2

Posted on 2006-06-27
5
809 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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:Kent Olsen
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 Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
DB2 join tables across schemas 5 645
db2 - u 3 250
Access to SYSIBM tables 7 125
The Event Monitor "DB2DETAILDEADLOCK" has reached its file 7 438
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

752 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