Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread Importing date format
Mon, Mar 22 2010 10:30 PMPermanent Link

benjiej

Core Technologies

I am importing a csv file into a temp table. The date fomat that is in the file will not import into DBIsam. I keep getting
"Invalid expression 11/10/2005 16:40 found in import data" Changing the Date format is out of the question and I need this information. Is there a way to bring this into my temp table and then into my actual data?

Benjie
Mon, Mar 22 2010 10:49 PMPermanent Link

benjiej

Core Technologies

benjiej wrote:

I am importing a csv file into a temp table. The date fomat that is in the file will not import into DBIsam. I keep getting
"Invalid expression 11/10/2005 16:40 found in import data" Changing the Date format is out of the question and I need this information. Is there a way to bring this into my temp table and then into my actual data?

Benjie

Sorry forgot to put my lines in.
"
DROP TABLE IF EXISTS Temp_Tracking;
CREATE TABLE Temp_Tracking
(
"ups_tracking_id" INTEGER,
"orders_id" INTEGER,
"ups_tracking_number" VARCHAR(25),
"ups_tracking_charge" FLOAT,
"ups_tracking_date" VARCHAR (10),
"ups_tracking_send_status" INTEGER
);
"
As you can tell very straight foward.
Benjie
Tue, Mar 23 2010 3:39 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

benjiej

>I am importing a csv file into a temp table. The date fomat that is in the file will not import into DBIsam. I keep getting
>"Invalid expression 11/10/2005 16:40 found in import data" Changing the Date format is out of the question and I need this information. Is there a way to bring this into my temp table and then into my actual data?
>
>Benjie
>
>Sorry forgot to put my lines in.
>"
>DROP TABLE IF EXISTS Temp_Tracking;
>CREATE TABLE Temp_Tracking
>(
>"ups_tracking_id" INTEGER,
>"orders_id" INTEGER,
>"ups_tracking_number" VARCHAR(25),
>"ups_tracking_charge" FLOAT,
>"ups_tracking_date" VARCHAR (10),
>"ups_tracking_send_status" INTEGER
>);
>"

Sorry if I'm being thick but you're not trying to import a timedate into a date field but into a varchar from the look of it, and 16 characters into a 10 character field. Try changing ups_tracking_date" VARCHAR (10) to ups_tracking_date" TIMESTAMP

Its a long time since I used DBISAM and especially the import function so I could be talking complete rubbish.

Roy Lambert
Tue, Mar 23 2010 10:17 AMPermanent Link

benjiej

Core Technologies

Roy,
    I believe the problem is the format. I did change to 'TIMESTAMP' and I get the exact same error. I used the VARCHAR field because I just want to bring the time stamp over into my records. I also used the VARCHAR as a 25 Character field as well.

Benjie



Roy Lambert wrote:

benjiej

>I am importing a csv file into a temp table. The date fomat that is in the file will not import into DBIsam. I keep getting
>"Invalid expression 11/10/2005 16:40 found in import data" Changing the Date format is out of the question and I need this information. Is there a way to bring this into my temp table and then into my actual data?
>
>Benjie
>
>Sorry forgot to put my lines in.
>"
>DROP TABLE IF EXISTS Temp_Tracking;
>CREATE TABLE Temp_Tracking
>(
>"ups_tracking_id" INTEGER,
>"orders_id" INTEGER,
>"ups_tracking_number" VARCHAR(25),
>"ups_tracking_charge" FLOAT,
>"ups_tracking_date" VARCHAR (10),
>"ups_tracking_send_status" INTEGER
>);
>"

Sorry if I'm being thick but you're not trying to import a timedate into a date field but into a varchar from the look of it, and 16 characters into a 10 character field. Try changing ups_tracking_date" VARCHAR (10) to ups_tracking_date" TIMESTAMP

Its a long time since I used DBISAM and especially the import function so I could be talking complete rubbish.

Roy Lambert
Tue, Mar 23 2010 11:22 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

benjiej


Just had a look in DBSys and there are edit boxes for setting the data and the time format. Have you tried that.

Roy Lambert [Team Elevate]
Tue, Mar 23 2010 12:32 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Benjie,

<< I am importing a csv file into a temp table. The date fomat that is in
the file will not import into DBIsam. I keep getting

"Invalid expression 11/10/2005 16:40 found in import data" Changing the
Date format is out of the question and I need this information. Is there a
way to bring this into my temp table and then into my actual data? >>

Are you using the Database System Utility, or are you doing this in code ?
You can change the date/time format in both, so you want to set them so that
they match the incoming data.  Here's an example:

IMPORT TABLE MyTable
FROM 'c:\myimportdata\import.csv'
DATE 'mm/dd/yyyy'
TIME 'hh:mm:ss'

--
Tim Young
Elevate Software
www.elevatesoft.com

Image