Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v5.2
  HXTT Cobol v2.1
  HXTT DBF v5.2
  Buy Now
  HXTT Excel v4.2
  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)

Sub Select column type
Fernando Hartmann
2009-08-17 11:09:13.0

I found one problem in the columns types returned by a sub select, if I execute a sub select retuning a date column the "upper" select see this column as a String, see the following sample, the three columns should return "equal", but this is not true !

Can you correct this please ?!

public class ColumnTipeBug {

public static void main(String[] args) throws Exception {
String connectionUrl;
Connection con;
connectionUrl = "jdbc:dbf:/C:/TEMP/";
con = DriverManager.getConnection(connectionUrl);

String sql =
" select " +
" CASE WHEN dateField = '2009-01-01' THEN 'equal' ELSE 'diff' END as DateXString," +
" CASE WHEN dateField = CDATE('01/01/2009','dd/MM/yyyy') THEN 'equal' ELSE 'diff' END as DateXCdate," +
" CASE WHEN CTOD(dateField) = CDATE('01/01/2009','dd/MM/yyyy') THEN 'equal' ELSE 'diff' END as CtodXCdate" +
" FROM (" +
" select CDATE('2009-01-01','yyyy-MM-dd') as dateField " +
" ) as m6 ";
PreparedStatement ps = con.prepareStatement(sql);
ResultSet resp = ps.executeQuery();
while ( {
System.out.println("DateXString = " + resp.getString("DateXString") );
System.out.println("DateXCdate = " + resp.getString("DateXCdate") );
System.out.println("CtodXCdate = " + resp.getString("CtodXCdate") );


The output is

DateXString = equal
DateXCdate = diff
CtodXCdate = equal

Re:Sub Select column type
HXTT Support
2009-08-18 09:42:11.0
Thanks. It's an issue which resulted by using default local calendar. Please download the latest package.

Search Key   Search by Last 50 Questions


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