Four Stars

how to use db2 bulk load component?

Hello,

I have to load over 30,000 records. I am thinking to use bulk load.

I just replaced tDB2Output component with tDB2BulkExec component. But it won't connect .

Does anyone has a sample on how to do the bulk loading?

I saw the other db components has outputBulkExec, but db2 doesn't have it.

Any suggestion will be very appreciated.

 

  • Data Integration
5 REPLIES
Four Stars

Re: how to use db2 bulk load component?

I found out I have to save the data into a file, then use the tDB2bulkExcu component.

But now I got this error "'db2cmd' is not recognized as an internal or external command,
operable program or batch file." 

Anyone knows what this error is for?

 

Seven Stars TRF
Seven Stars

Re: how to use db2 bulk load component?

"You can think of the DB2 command window as a DB2 shell (db2cmd.exe) that extends the Windows shell (cmd.exe) to provide support for DB2 commands and SQL statements."
Source https://www.ibm.com/developerworks/data/library/techarticle/0307fierros/0307fierros.html
So you need to install it before to go with tDB2BulkExec (same as for sqlldr when working with Oracle).

TRF
Four Stars

Re: how to use db2 bulk load component?

Thanks, TRF!

I checked, I do have DB2 command line tools installed.

But how could I know if Talend can find the db2cmd?

 

db2 command.png

 

bulk.png

 

 

 

Four Stars

Re: how to use db2 bulk load component?

I added db2cmd into system path variable. Then the db2cmd error is gone.

Now when I ran the job again. I got error:

DB21005E  An error occurred while accessing the file
"C:\talend\TOS_DI-20161216_1026-V6.3.1\workspace\db2_ingest_cmd.db2"

What does this mean? I didn't see db2_ingest_cmd.db2 file in the directory after the job is done.

bulk1.png

 

 

 

 

 

 

 

 

 

 

 

 

Four Stars

Re: how to use db2 bulk load component?

I read Talend document for this db2 bulk component. It  mentioned something about date file, "This file is located on the machine specified by the URI in the Host field so it should be on the same machine as the database server."

I cannot put the file on the database server. I guess this is the problem. 

Just wonder if there is any other way to do the bulk load. Anyone has any experience on this? Thanks!