Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v7.1
  HXTT Cobol v5.0
  HXTT DBF v7.1
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Excel v6.1
  HXTT Json v1.0
  HXTT Paradox v7.1
  HXTT PDF v2.0
  HXTT Text(CSV) v7.1
  HXTT Word v1.1
  HXTT XML v4.0
Offshore Outsourcing
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
   
   
   
Heng Xing Tian Tai Lab of Xi'an City (abbr, HXTT)

HXTT DBF
Sub Select column type
Fernando Hartmann
2009-08-17 11:09:13

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/";
Class.forName("com.hxtt.sql.dbf.DBFDriver");
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 (resp.next()) {
System.out.println("DateXString = " + resp.getString("DateXString") );
System.out.println("DateXCdate = " + resp.getString("DateXCdate") );
System.out.println("CtodXCdate = " + resp.getString("CtodXCdate") );
}
resp.close();
ps.close();
con.close();

}
}

The output is

DateXString = equal
DateXCdate = diff
CtodXCdate = equal





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

Search Key   Search by Last 50 Questions




Google
 

Email: webmaster@hxtt.com
Copyright © 2003-2019 Heng Xing Tian Tai Lab of Xi'an City. | All Rights Reserved. | Privacy | Legal | Refund | Sitemap