472,961 Members | 1,792 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Import of csv-File

Hello all,

I would like to import a comma separated values file to DB2 UDB 8.2.
This file also contains values of type DATE and TIMESTAMP having for example
the following format 900925 033701.0000 (yyMMdd HHmmss.ffff).

For the import, I right-click on the table -> Import and then choose the
file with file type "DEL" and confirm the mapping given in "columns".
But as result, I get that all rows are refused. Could I somewhere find more
detailed information WHICH column causes the problem?
With trying out and leaving away different columns, I found out that the
error comes from the DATE and TIMESTAMP column, but is there a possibility
to find it out directly after getting the result that rows are refused?

I think that "my" DATE and TIMESTAMP columns cound not be inserted because
of the format. How could I tell DB2 which format my date have? Is there
anything like DTS for MS SQL Server 2000 also for IBM DB2?

Would be glad if anybody could help me in this topic.

Cheers,
Ina
Nov 12 '05 #1
3 30824
Look in your docs. for the import command and within for the MODIFIED BY
option.
It will show (there are examples I think) what to specify to tell it of your
timstamp format.
I don't have access to my docs. for the moment.
HTH, Pierre.

--
Pierre Saint-Jacques
SES Consultants Inc.
514-737-4515
"Ina Schmitz" <kl***@fmi.uni-passau.de> a écrit dans le message de
news:d0*************@news.t-online.com...
Hello all,

I would like to import a comma separated values file to DB2 UDB 8.2.
This file also contains values of type DATE and TIMESTAMP having for example the following format 900925 033701.0000 (yyMMdd HHmmss.ffff).

For the import, I right-click on the table -> Import and then choose the
file with file type "DEL" and confirm the mapping given in "columns".
But as result, I get that all rows are refused. Could I somewhere find more detailed information WHICH column causes the problem?
With trying out and leaving away different columns, I found out that the
error comes from the DATE and TIMESTAMP column, but is there a possibility
to find it out directly after getting the result that rows are refused?

I think that "my" DATE and TIMESTAMP columns cound not be inserted because
of the format. How could I tell DB2 which format my date have? Is there
anything like DTS for MS SQL Server 2000 also for IBM DB2?

Would be glad if anybody could help me in this topic.

Cheers,
Ina


Nov 12 '05 #2
Hello Pierre,

thanks for your answer.
Look in your docs. for the import command and within for the MODIFIED BY
option.
It will show (there are examples I think) what to specify to tell it of
your
timstamp format.

I studied the modified by option in more detail, but didn't find a solution
in the docs for my problem:
I have to modify TWO formats, for example:

IMPORT FROM "test.csv" OF
DEL
modified by dateformat="YYYYMMDD"
modified by timestampformat="YYYYMMDD HHMMSS.UUUUUU"
METHOD P (1, 2)
INSERT INTO TESTTABLE
(DATUM, ZEITSTEMPEL)

Here, I have the problem, that I couldn't find out how to modify TWO
formats. Connected with AND or "," it doesn't work. Does anybody know an
working example for this?
The other problem I have is that I have only YY and not YYYY. I don't want
to add "19" in front of my year in every row in the csv-file, because it has
thousands of rows. Does anybody know a workaround for this problem, how I
could use 2-digit-years?

Thanks a lot in advance for any good ideas!
Cheers,
Ina
Nov 12 '05 #3
Hallo Ina,

The correct syntax is

IMPORT FROM "test.csv"
OF DEL
modified by dateformat="YYYYMMDD" timestampformat="YYYYMMDD HHMMSS.UUUU"
METHOD P (1, 2)
INSERT INTO TESTTABLE
(DATUM, ZEITSTEMPEL)

, but the year must have four digits. Sorry!

Regards / Gruß Stefan

----------------------------------
Stefan M. Mihokovic
email: it at stemi dot de


"Ina Schmitz" <kl***@fmi.uni-passau.de> schrieb im Newsbeitrag
news:d0*************@news.t-online.com...
Hello Pierre,

thanks for your answer.
Look in your docs. for the import command and within for the MODIFIED BY
option.
It will show (there are examples I think) what to specify to tell it of
your
timstamp format.

I studied the modified by option in more detail, but didn't find a
solution in the docs for my problem:
I have to modify TWO formats, for example:

IMPORT FROM "test.csv" OF
DEL
modified by dateformat="YYYYMMDD"
modified by timestampformat="YYYYMMDD HHMMSS.UUUUUU"
METHOD P (1, 2)
INSERT INTO TESTTABLE
(DATUM, ZEITSTEMPEL)

Here, I have the problem, that I couldn't find out how to modify TWO
formats. Connected with AND or "," it doesn't work. Does anybody know an
working example for this?
The other problem I have is that I have only YY and not YYYY. I don't want
to add "19" in front of my year in every row in the csv-file, because it
has thousands of rows. Does anybody know a workaround for this problem,
how I could use 2-digit-years?

Thanks a lot in advance for any good ideas!
Cheers,
Ina

Nov 12 '05 #4

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

Similar topics

2
by: Michel Feldheim | last post by:
Hi everybody, I have some big csv-like files with 15.000 and more artikles stored in it. They should be put into a mysql database. I thought about PHP processing but only the read and print...
11
by: Bruce A. Julseth | last post by:
Newbie Question: Is there a way to import MS Access into MySQL? Maybe create a CSV or something. If so, what would be the SQL to do this? Thanks... Bruce
3
by: mir nazim | last post by:
hi, i m unable to import csv module. it says: ImportError: no module named csv. plz help me. is csv module not a part of standard dist?
0
by: Phil Perrin | last post by:
------=_NextPart_000_0001_01C3663D.5E3EAD70 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit I'm a relative newbie to MySql, and I've got a small project I'm working...
2
by: Rahul Gupta | last post by:
Hello Group, I want to import the csv format data into my progrm frm C# using oledb/odbc. Is it possible, how? Please Help, Rahul.
7
by: phillip.s.powell | last post by:
We're looking at a GUI interface for our MySQL DB and I am interested in MySQL Administrator, however, one of our requirements is to be able to import/export databases. Is this possible or do I...
1
by: GSP | last post by:
Using SQLyog 5.02 into MySQL server 5.0. Have built table structures and am trying to import data from CSV. I get a rather non-descript dialog box saying only "Error while importing data". Does...
2
by: pendell | last post by:
I am working with a client running 2003 Access. Some time ago I built them an import spec for use with the Import Wizard. Several months later, I have been called back and asked to solve a...
1
by: tezza98 | last post by:
I need some help. Im using a dtsrun command to import 9 tables into an Access database, most of the tables have about 1000 rows, but one has 20000+ rows and grows everyday. Im Using Access 2003...
1
by: =?Utf-8?B?UGF0?= | last post by:
In Windows Mail, in the import process, I get to a window that wants me to Browse for the CSV files.... I don't know how to find the Outlook files - are they already in CSV format? HELP!! I can...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.