473,406 Members | 2,387 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

db2 load content from text file

Hi Guys,

I want to load contents from a text file to a db2 table.I have already created the table with the same column names as in the text file.Can anybody help me out?

Thanks in advance,
Vandana
Jan 2 '08 #1
7 27444
Hi Guys,

I want to load contents from a text file to a db2 table.I have already created the table with the same column names as in the text file.Can anybody help me out?

Thanks in advance,
Vandana
Dear Vandana,

You can use the db2 load utiliy script to load the data from the text file which is your source.
Jan 4 '08 #2
Dear Vandana,

You can use the db2 load utiliy script to load the data from the text file which is your source.


Hi,
Thank you for your reply.

My source ASCII text file is in Windows and i want to load it into db2 table in Linux environment.I tried with load command.But then its showing invalid source path error.

Looking forward to your reply.
Vandana
Jan 4 '08 #3
Dear Vandana,

use the following script:

db2 Load From </pathname/filename> OF ASC modified by stripblanks reclen <the record length coming from the ascii file> method L(the positions) message <the msg pathname where the warnings and the error has to go> INSERT INTO table name(columns names)

regards,
Shilpa



Hi,
Thank you for your reply.

My source ASCII text file is in Windows and i want to load it into db2 table in Linux environment.I tried with load command.But then its showing invalid source path error.

Looking forward to your reply.
Vandana
Jan 9 '08 #4
Dear Vandana,

use the following script:

db2 Load From </pathname/filename> OF ASC modified by stripblanks reclen <the record length coming from the ascii file> method L(the positions) message <the msg pathname where the warnings and the error has to go> INSERT INTO table name(columns names)

regards,
Shilpa

Hi Shilpa,

I tried with the script which you have given.But again it is showing invalid source path error.I think its because the source ASCII file is in windows and Db2 table, which i am trying to load is in Linux OS.So windows path name cannot be identified by a linux OS without knowing its IP address.Can u please try on this concept?


Regards,
Vandana
Jan 10 '08 #5
docdiesel
297 Expert 100+
Hi,

I enhanced the thread title a little bit to make it more accurate and give others a better chance to find it.

Btw., you'll find some examples at IBM site (http://publib.boulder.ibm.com/infoce...c/r0004601.htm ).

Regards,

Bernd
Jan 11 '08 #6
Jal
10
Use the foll:
db2 load Client from <Source file name> of del Modified by COLDEL, UseDefaults Messages <Error file name> insert into LOAD.T_ORDERS NONRECOVERABLE

Client specifies that you are running the LOAD command from a client m/c.
del specifies that the file is delimited.
Coldel, specifief that the column delimiter is comma(,)
insert says that the records are to be appended (insert) to the table.

for more details refer DB2 documentation
"Data Movement Utilities Guide and Reference"
Jan 21 '08 #7
Use the foll:
db2 load Client from <Source file name> of del Modified by COLDEL, UseDefaults Messages <Error file name> insert into LOAD.T_ORDERS NONRECOVERABLE

Client specifies that you are running the LOAD command from a client m/c.
del specifies that the file is delimited.
Coldel, specifief that the column delimiter is comma(,)
insert says that the records are to be appended (insert) to the table.

for more details refer DB2 documentation
"Data Movement Utilities Guide and Reference"


Hi,

Thanks a lot!!!!

Regards,
Vandana
Jan 29 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: | last post by:
The data file is a simple Unicode file with lines of text. BCP apparently doesn't guarantee this ordering, and neither does the import tool. I want to be able to load the data either sequentially...
60
by: Julie | last post by:
What is the *fastest* way in .NET to search large on-disk text files (100+ MB) for a given string. The files are unindexed and unsorted, and for the purposes of my immediate requirements, can't...
2
by: Johan Wendelstam | last post by:
Hi I am trying to let the users select a txt file on their drive and then import all the text in it to a textbox ? I have figured out how to access a file on the server and import it but not how...
1
by: Parvez | last post by:
BOF BD|0001|20060403001|1 BO|1|BSE|0001|B|06/B-04130973|77160200000000001|200604031145|2005061|20060403|30/04/2006-03/04/2006|500085|EQT|AR|27.55|3 BT|1|1001|115031|100|29.05...
1
by: galivio | last post by:
I need a code in C where accepts inputs coming from an external text file and will give an output stored on another text file. For example, a C program to compute the sum of the two integers. The...
2
by: shahriarshams | last post by:
Hiya, I have a series of data in a text file which contains date and rainfall. I want to load the text file into my rainfall table into the database. The text file is 1-Jan-89 1 2-Jan-89 0...
6
by: ivan.perak | last post by:
Hello, im a beginner in VB.NET... The thing i would like to do is as it follows.... I have a text file (list of names, every name to the next line) which is about 350000 lines long. I would...
1
by: vjunkl | last post by:
Hello, I have a content text file in my project and I'd like to copy it to a folder at some point in the execution of the application(not during a build). If this is not possible, how about...
1
by: mrjaune | last post by:
Hi Everyone, I try to load a text file into a listview. Here is my text file: 10 "Babar" 9 6 15 "Robert" 3
8
by: amphetaman | last post by:
Is there a safe (unlikely to cause overflows or segfaults) way to load a text file into a char ** array? I thought of using getline, but it needs a fixed-length string, and I don't know how many...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.