473,815 Members | 1,809 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

May 2 '06 #1
2 2603
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("COLD EL0x09");
ModType = static_cast<DB2 CLI::sqlchar*>( malloc(sizeof(s hort) +
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

May 2 '06 #2
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

May 2 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2250
by: Rick | last post by:
When using the load utility on a CSV file, it seems I always need to edit the input file and add an extra comma after the last field in order for MySql to parse the line properly. I use a command like: LOAD DATA INFILE 'absolute path to file.csv' IGNORE INTO TABLE table-name FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED
1
5044
by: Carmine | last post by:
I'm getting this error when I submit the job: DSNU000I DSNUGUTC - OUTPUT START FOR UTILITY, UTILID = LOADSQL DSNU005I DSNUGPRS - EXEC SQL DSNU082I DSNUGPRS - INVALID KEYWORD - EXEC DSNU005I DSNUGPRS - DECLARE C1 CURSOR FOR SELECT * FROM LIQ53TST.TLS_BRANCH DSNU005I DSNUGPRS - ENDEXEC DSNU005I DSNUGPRS - LOAD DATA DSNU005I DSNUGPRS - INCURSOR(C1) DSNU005I DSNUGPRS - REPLACE LOG NO
7
7587
by: Xie Qing | last post by:
Hi all, Is there a tool or view to display the status of a Load utility job on windows or Unix(say loading few million rows into a table)? I understand in OS/390 there is a dis utility to show the status of the utility. Is it also possible in UDB? I'm using UDB 8.1 on windows 2000. Thanks for your time.
3
2317
by: claus.hirth | last post by:
When I execute the following statment using the Command Center it works: LOAD CLIENT FROM 'Y:\\TheFixedWidthData.txt' OF ASC METHOD L ( 1 1,2 11,12 17) REPLACE INTO S00.TheTargetTable NONRECOVERABLE WITHOUT PROMPTING Yet when I try to execute the same statement in a PreparedStatement it does not work, but gives me a SQLException:
6
8922
by: jrthor2 | last post by:
I have a shell script I am trying to run that loads a table from a control file. The file I am trying to load is delimited by the "}" character. How do I set the delimeter code? Here is my load statement: db2 load client from /loadspace/re000000.txt of del replace into INET.INSRP_SURP_PROP_TBL nonrecoverable To be even more explicit, I am trying to replicate the below oracle
5
2182
by: Konstantin Andreev | last post by:
Recently I became interested, - Are the data, bulk loaded in the table with LOAD utility, consume the same disk space as loaded with IMPORT utility? The answer turned out to be NOT ! Here is a nutshell description of the test. The testing was done at "DB2/LINUX 8.2.3". Tables for tests: F4106 has 5203 rows, 32 columns. F42199 has 1399252 rows, 245 columns.
1
5965
by: huyuhui | last post by:
The following is a question of LOAD utility. Question: How does the DB2 enforce table check constraints for data added to table with the LOAD utility? A. With the BUILD phase of LOAD B. With the SET INTEGRITY statement C. With the DELETE phase of the LOAD D. With the UPDATE CONSTRAINTS statement Answer is A
1
3967
by: dbuser | last post by:
Hi I am new to Db2. I am planning to load around 5 million Data using DB2 LOAD utility. Do this utility have an inbuilt COMMIT statement so that i do not get any table locks/deadlock error. Also if it does commit when does the records gets COMMITED meaning at the end of the full load or after each loaded record Is there any COMMIT syntax that i can add to the load utility Thanks
0
1964
by: Eric Davidson | last post by:
I am try to find a way to get load to reject a record if the data is too large and not just truncate it. eg. c:\temp\fred3.txt ------ a23456789012345678901234567890 b23456789012345678901234567890b234567890
2
9398
by: venkateswari | last post by:
Need Information on ‘how to terminate a load utility?’ I am getting the following error while loading a table: DB2 OBJECT DEFINITION(S) HAVE CHANGED PRIOR TO UTILITY RESTART. UNABLE TO PROCEED UTILITY EXECUTION TERMINATING, RETURN CODE = 8
0
10672
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10408
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10145
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7687
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6897
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5570
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4359
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3888
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3030
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.