Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v5.2
  HXTT Cobol v2.1
  HXTT DBF v5.2
  HXTT Excel v4.2
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Paradox v5.2
  HXTT Text(CSV) v5.2
  HXTT XML v1.2
Offshore Outsourcing
Oracle Data Import/Export
DB2 Data Import/Export
Sybase Data Import/Export
Free Resources
  Firewall Tunneling
  Search Indexing Robot
  Conditional Compilation
  Password Recovery for MS Access
  Password Recovery for Corel Paradox
  Checksum Tool for MD5
  Character Set Converter
  Pyramid - Poker of ZYH
   
   
   
Hongxin Technology & Trade Ltd. of Xiangtan City (abbr, HXTT)

HXTT Excel
Strings in column of type DATE
Remco Schoen
2009-11-04 06:26:33.0
If I have a string in a column of type DATE, the driver tries to convert the string to a date according to the format 'yyyy-MM-dd'. If the string isn't in this format, this can result in a wrong date value. For instance January 2nd becomes February 1st if you have a date as 'dd-MM-yyyy'.

Is there a possibility to give an error, when a string is encountered in stead of a implicit conversion to a date?

With kind regards,

Remco Schoen
Re:Strings in column of type DATE
HXTT Support
2009-11-04 12:17:56.0
Please download the latest package, which will detect and refused to convert wrong value if you set dateFormat=yyyy-MM-dd .
Re:Re:Strings in column of type DATE
Remco Schoen
2009-11-06 02:00:11.0
This still fails in version 2.2.103, even with the new parameter and the correct format.

Is it just possible to throw an exception when a string is encountered in a DATE column?

The ODBC driver from Microsoft doesn't try to convert strings to a date, but returns NULL in such cases. We think this is also unwanted behaviour, because the user isn't informed, that he has faults in his data.
Re:Re:Re:Strings in column of type DATE
HXTT Support
2009-11-10 05:53:03.0
>Is it just possible to throw an exception when a string is encountered in a
>DATE column?
HXTT Text (CSV) latest package will do such action.
Re:Re:Re:Re:Strings in column of type DATE
Remco Schoen
2009-11-11 06:39:52.0
I tried this in version 2.2.104 and an error is not thrown, the wrong date is still returned.
Re:Re:Re:Re:Re:Strings in column of type DATE
HXTT Support
2009-11-11 07:19:48.0
But in my test, it throws the error. Please paste you test data and jdbc url.
Re:Re:Re:Re:Re:Re:Strings in column of type DATE
Remco Schoen
2009-11-11 07:39:44.0
I see now that you are talking about the Text-driver and this about the Excel-driver, could that explain it maybe?

I do have test-data, but that is an Excel-file and I can not paste that.
Re:Re:Re:Re:Re:Re:Re:Strings in column of type DATE
HXTT Support
2009-11-11 07:44:02.0
Yeah. It seems that HXTT Excel need an ignoreDirtyData connection property too. We will test and give a solution.
Re:Re:Re:Re:Re:Re:Re:Re:Strings in column of type DATE
HXTT Support
2009-11-13 05:38:59.0
Please try the latest package, which HXTT Excel complemented also dateFormat connection property.
Re:Re:Re:Re:Re:Re:Re:Re:Strings in column of type DATE
Remco Schoen
2009-12-09 07:32:23.0
Sorrty for the late response.

This parameter works fine.

We do have another request about this. Usually you will start without this parameter and won't directly notice that there are strings in a column with dates. Is it possible that if you don't supply this parameter and a string is encountered to throw an exception? Resolving the exception could be done by changing the Excel-sheet or start using this parameter.
Re:Re:Re:Re:Re:Re:Re:Re:Strings in column of type DATE
HXTT Support
2009-12-16 04:18:59.0
>Is it possible that if you don't supply this parameter and a string
>is encountered to throw an exception?
The default format is 'yyyy-MM-dd', and you needn't to set.
Re:Re:Re:Re:Re:Re:Re:Re:Strings in column of type DATE
Remco Schoen
2009-12-24 04:55:36.0
The thing is, that I would like to know, if there is a string in a date column and that I only can get it to work by doing an explicit action. But perhaps an extra connection parameter would be more clear. For instance that it will throw an exception by default and that with the parameter set you can convert it to a date.

With this parameter set, you can know your Excel-sheet also has strings in a date column, but that you can accept this.
Re:Re:Re:Re:Re:Re:Re:Re:Strings in column of type DATE
HXTT Support
2009-12-24 06:45:48.0
>For instance that it will throw an exception by default and that with the
>parameter set you can convert it to a date.
It will throw an excepiton. For instance if maxScanRows=10, but it meet a string value at row 12.

>With this parameter set, you can know your Excel-sheet also has strings in a date
>column, but that you can accept this.
HXTT Excel supports date, int, doulbe, and string in the same column, and will think it's an object type.

Search Key   Search by Last 50 Questions




Google
 

Address: 9 Station Rd., Xiangtan City, Hunan Province, P.R. China
Postcode: 411100
Phone: (86)731-58225727
Fax: (86)731-58225727
Email: webmaster@hxtt.com
Copyright © 1999-2011 Hongxin Technology & Trade Ltd. | All Rights Reserved. | Privacy | Legal | Sitemap