Unix Technical Forum

Load Utility

This is a discussion on Load Utility within the DB2 forums, part of the Database Server Software category; --> Hi All I am new to DB2. So i dont have knowledge of DB2 API. I dont have knowledge ...


Go Back   Unix Technical Forum > Database Server Software > DB2

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 06:56 AM
Suresh
 
Posts: n/a
Default Load Utility

Hi All

I am new to DB2. So i dont have knowledge of DB2 API. I dont have
knowledge of how to use API ...

I have requirement of loading data from tab delimited text file in to
Db2. For this I came across LOAD utility in DB2. But now my problem is
that I am loading data periodically without any user intervation....So
I want to call this load utility by using java program or by using some
routine such as Stored procedure or user defined function is it
possible? If so please provide me detail and if possible then code
also....

Thanks
Suresh

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 06:56 AM
Kiran Nair
 
Posts: n/a
Default Re: Load Utility

There is a db2 load API in C ...which you can use for the same ..
Sample :
http://publib.boulder.ibm.com/infoce...tbload-sqc.htm

Knuth Stoze had given a wonderful explanation for the same

http://www-128.ibm.com/developerwork...ndex.html#load

for tab delimited text you
may need to add FILETYPE modifier ..the ascii code of tabcharacther ie
0x09..something like below

DB2CLI::sqlchar* pModType;
String modString("COLDEL0x09");
ModType = static_cast<DB2CLI::sqlchar*>(malloc(sizeof(short) +
modString.Size() + 1));
pModType->length = modString.Size();
strcpy(pModType->data, modString);

You can try using sysproc.db2load stored procedure with filetype
modfier COLDEL0x09

Regards,
Kiran Nair

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-27-2008, 06:56 AM
Suresh
 
Posts: n/a
Default Re: Load Utility

Hi Kiran

By using second link i got much more idea...
But This is load data by using default format...

Where should I change in .c file or script file so that i can load tab
delimited text file...

Because I need to load tab delimited text file...

Thanks and regards
Suresh

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:02 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com