469,267 Members | 909 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,267 developers. It's quick & easy.

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 26314
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

Post your reply

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

Similar topics

2 posts views Thread by Johan Wendelstam | last post: by
1 post views Thread by Parvez | last post: by
6 posts views Thread by ivan.perak | last post: by
1 post views Thread by mrjaune | last post: by
8 posts views Thread by amphetaman | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.