Import table in Ms. Excel file to DB2 table

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
zhaicaibing
Participant
Posts: 49
Joined: Wed Jun 11, 2003 12:49 am

Import table in Ms. Excel file to DB2 table

Post by zhaicaibing »

Hi,

Anyone of you has an idea to import table in an Excel worksheet to a DB2 table?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

You only need to declare your Excel sheet as a system ODBC data source and you are in business.

Fortunately you are on a Windows platform so this is easy; if the DS server is on UNIX and you need to access Excel it becomes a bit more complicated and expensive.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It is absolutely vital that the Excel worksheet is well-formed for ODBC - that is, it has columnar format and column headings.

Also, when importing the table definition from the ODBC data source, you need to check the "include system tables" box, because worksheets are presented as system tables, indicated by the "$" on the imported table name.

Finally note that the ODBC Enterprise stage can only operate in sequential mode when performing a SELECT.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
zhaicaibing
Participant
Posts: 49
Joined: Wed Jun 11, 2003 12:49 am

Import tables in Ms. Excel file to DB2 table

Post by zhaicaibing »

Hi,

What if the Excel file has multiple sheet? how can I extract tables in the subsequence sheet?

Please advise. Thanks.
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

Check out the perl libraries. They have freely available libraries that read .xls files and normalize the worksheets into separate files.

Otherwise, re-read Ray's last post, because he states worksheets are different tables. You'll need to know the worksheet names to know the table names.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
rajeev_prabhuat
Participant
Posts: 136
Joined: Wed Sep 29, 2004 5:56 am
Location: Chennai
Contact:

Accessing MS Excel From UNIX platrom

Post by rajeev_prabhuat »

ArndW wrote:You only need to declare your Excel sheet as a system ODBC data source and you are in business.

Fortunately you are on a Windows platform so this is easy; if the DS server is on UNIX and you need to access Excel it becomes a bit more complicated and expensive.
Hi,

I have to access MS Excel spreedsheet from UNIX platform what are the complexity that i will have to face to do this activity. As speficid in this post.

Thanks in advance.

Regards,
Rajeev Prabhu
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

HI Rajeev Prabhu,
You can do this by converting existing excel to Comma Seperated Value file format. Then you can access from unix.
But again iam not sure about the easy way to get the each spread sheet into the csv format.

regards
Kumar
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Hello Rajeev,

accessing Excel directly on UNIX is not a builtin feature of DataStage or of UNIX. There are software packages that will let you declare an Excel document to be accessible via ODBC on UNIX, but you need to buy the software. DataDirect is one supplier of this software and there might be some free packages out there that do this (it's worth checking on Google or Yahoo! or your favorite search engine). Also try searching this forum with "UNIX ODBC Excel" to see some more responses to this question.

I initially posted the ODBC definition since you did state that you are on a Windows platform.
rajeev_prabhuat
Participant
Posts: 136
Joined: Wed Sep 29, 2004 5:56 am
Location: Chennai
Contact:

Post by rajeev_prabhuat »

ArndW wrote:Hello Rajeev,

accessing Excel directly on UNIX is not a builtin feature of DataStage or of UNIX. There are software packages that will let you declare an Excel document to be accessible via ODBC on UNIX, but you need to buy the software. DataDirect is one supplier of this software and there might be some free packages out there that do this (it's worth checking on Google or Yahoo! or your favorite search engine). Also try searching this forum with "UNIX ODBC Excel" to see some more responses to this question.

I initially posted the ODBC definition since you did state that you are on a Windows platform.
Hi,

Thankyou very much for your inputs. I will check as you have mentioned.

One more thing, what about reading multiple sheets from a excel sheet, is this also done through 3rd party tool in unix platform?

Regards,
Rajeev Prabhu
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I think that DataDirect (the most common tool) cannot do this. You'd have to research a bit. If you do find something that can do this, please post it on this thread.
Post Reply