472,969 Members | 2,228 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,969 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 4849
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...
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
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...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
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...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
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...
3
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.