Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v6.0
  HXTT Cobol v3.0
  HXTT DBF v6.0
  Buy Now
  HXTT Excel v5.0
  HXTT Paradox v6.0
  HXTT Text(CSV) v6.0
  HXTT XML v2.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 Ltd. of Beijing 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


Copyright © 1999-2017 Heng Xing Tian Tai Ltd. of Beijing City. | All Rights Reserved. | Privacy | Legal | Sitemap