473,327 Members | 1,952 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,327 software developers and data experts.

fyi load csv file from windows

sjs
Putting together other messages from this group I managed to load
variable length csv data using d2cmd/db2 tools under Windows. Another
catch was being able to load dates that may be null.

Here's the command I used:

load client from c:\temp\sample.csv of del modified by usedefaults
dateformat="YYYY-MM-DD" insert into sample_tbl nonrecoverable

By setting the dateformat, it quiets the error "The syntax of the string
representation of a datetime value is incorrect." By using usedefaults,
it makes the load set the field to whatever the default is in the table
if a value isn't provided.

Here's sample csv file data with a string, a date, and an integer. The
second line has an empty date which will be set to null if that's what
the field default value is for the table.

"apples","2004-08-26",100
"bananas",,200

Nov 12 '05 #1
3 4864
Ian
sjs wrote:
Putting together other messages from this group I managed to load
variable length csv data using d2cmd/db2 tools under Windows. Another
catch was being able to load dates that may be null.

Here's the command I used:

load client from c:\temp\sample.csv of del modified by usedefaults
dateformat="YYYY-MM-DD" insert into sample_tbl nonrecoverable

By setting the dateformat, it quiets the error "The syntax of the string
representation of a datetime value is incorrect." By using usedefaults,
it makes the load set the field to whatever the default is in the table
if a value isn't provided.

Here's sample csv file data with a string, a date, and an integer. The
second line has an empty date which will be set to null if that's what
the field default value is for the table.

"apples","2004-08-26",100
"bananas",,200


The dates in your CSV file should not be enclosed by quotes. This
should be:

"apples",2004-08-26,100
"bananas",,200
As for the second row, the date field will have a NULL regardless of
whether there is a defined default value (unless the date column is
defined NOT NULL, in which case the row will be rejected).

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Nov 12 '05 #2

"sjs" <sj*****@hotmail.com> wrote in message
news:cg***********@spnode25.nerdc.ufl.edu...
Putting together other messages from this group I managed to load
variable length csv data using d2cmd/db2 tools under Windows. Another
catch was being able to load dates that may be null.

Here's the command I used:

load client from c:\temp\sample.csv of del modified by usedefaults
dateformat="YYYY-MM-DD" insert into sample_tbl nonrecoverable

By setting the dateformat, it quiets the error "The syntax of the string
representation of a datetime value is incorrect." By using usedefaults,
it makes the load set the field to whatever the default is in the table
if a value isn't provided.

Here's sample csv file data with a string, a date, and an integer. The
second line has an empty date which will be set to null if that's what
the field default value is for the table.

"apples","2004-08-26",100
"bananas",,200

I don't quite see what your question or problem is. Could you please clarify
what you want from the people on the newsgroup?

Rhino

Nov 12 '05 #3
Ummm.... It *SAYS* FYI. It's a helpful tip or suggestion. Last I
recall, those were acceptable items to post. :)

Mairhtin

"Rhino" <rh****@NOSPAM.sympatico.ca> wrote in
news:mG********************@news20.bellglobal.com:

"sjs" <sj*****@hotmail.com> wrote in message
news:cg***********@spnode25.nerdc.ufl.edu...
Putting together other messages from this group I managed to load
variable length csv data using d2cmd/db2 tools under Windows.
Another catch was being able to load dates that may be null.

Here's the command I used:

load client from c:\temp\sample.csv of del modified by usedefaults
dateformat="YYYY-MM-DD" insert into sample_tbl nonrecoverable

By setting the dateformat, it quiets the error "The syntax of the
string representation of a datetime value is incorrect." By using
usedefaults, it makes the load set the field to whatever the default
is in the table if a value isn't provided.

Here's sample csv file data with a string, a date, and an integer.
The second line has an empty date which will be set to null if that's
what the field default value is for the table.

"apples","2004-08-26",100
"bananas",,200

I don't quite see what your question or problem is. Could you please
clarify what you want from the people on the newsgroup?

Rhino


Nov 12 '05 #4

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

Similar topics

3
by: Trevor Fairchild | last post by:
I am making a program that categorizes pictures. The picture paths are stored in an Access Database, vb6 connects using adodc controls. This program works specifically with .jpg files. It will be...
7
by: Eric.Jones | last post by:
I've encountered a strange error with loading delimited files from a Samba (SMB) network drive, has anyone else seen this before? (Platform: WinXP Pro, UDB PE 8015, level 02060106, SAMPLE db) ...
1
by: Greg Patrick | last post by:
My problem: I load an some assemblies (strong named) from a byte array using Assembly.Load(byte). They load fine. But one one of them is actually accessed, it's referenced assemblies can't be...
2
by: John Alesse | last post by:
Hi, I've created a very simple winforms control using the c# wizard in VS .net 2003 that is nothing but a System.Windows.Forms.UserControl. There are no other controls on the form It takes IE 12...
22
by: EP | last post by:
When running my asp.net hosting service (asp.net without IIS), on server 2003 with IIS not installed, I get the following when trying to process a request. "System.DllNotFoundException: Unable to...
22
by: Brett Romero | last post by:
If my UI app uses three DLLs and two of those DLLs reference something named utilities.dll, does the UI app load utilities.dll twice or does the compiler recognize what is going on and load...
2
by: Jeff | last post by:
Hey asp.net 2.0 My asp.net 2.0 project has got a assembly load problem: Some of my web.config settings: <membership defaultProvider="AH_MembershipProvider" userIsOnlineTimeWindow="15">
8
by: Joe Withawk | last post by:
I have a solution consisting of a c# project as win application and a c++ project as classlibrary. Both are .net 2.0 The classlibrary handles some loading of quicktime movies, but that should not...
2
by: David Thielen | last post by:
So we have moved our app from .NET version 2.X in IIS6 to a Windows 2008 Server running IIS7. We have copied all files to the Windwardreports\apps directory and that apps directory has been...
8
by: martinsmith160 | last post by:
Hi everyone I am trying to create a simple wpf program that allows a user to select an image from a combo box and then where they click on th screen draw that image at the mouse co-ordinates. The...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.