Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v7.1
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Cobol v5.0
  HXTT DBF v7.1
  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 ACCESS
urgent problem with 2 columns with same name
menno van baalen
2010-10-19 00:06:29
hi support,

I get an unexpected query result when running a query that has two columns with the same name (from two different tables). I use column aliases for both columns.

In the support list of the HXTT DBF component I found the issue "Fields used in ON condition of JOIN have an explicit alias" (issued by Robbert Jan Grootjans, 2010-10-08 03:32:31.0) that it's meant to work like this:

------
quote:
SELECT a."barid", b."barid" from "foo" a LEFT JOIN "bar" b ON a."barid" = b."id"
would result in 'a.barid' and 'b.barid' (instead of an error that the query was ambiguous, which you get in most DBMS's)

SELECT a."barid" from "foo" a LEFT JOIN "bar" b ON a."barid" = b."id"
would result in 'barid'
------

Well, I can understand that it works like this when no aliases are used, but when I use aliases for the 'barid' columns in the above example, I would expect that the provided aliases will be used as columnnames, but this is not how it works at the moment.

consider the following query:
------
SELECT a.barid as barid_foo, b.barid as barid_bar from foo a LEFT JOIN bar b ON a.barid = b.id;

Expected result (as in other database drivers):
a resultset with two columns named barid_foo and barid_bar.

result I get from the HXTT Access driver 4.0 :
a resultset with two columns named a.barid_foo, b.barid_bar
------

As we use the HXTT driver on one server and ms access JET drivers on our other servers, using the same server software, the results should be the same in both drivers. Is there a workaround for this behaviour, or is there an easy way to fix this?

Thank in advance,
Menno van Baalen
Re:urgent problem with 2 columns with same name
HXTT Support
2010-10-19 02:56:19
>Is there a workaround for this behaviour, or is there an easy way to fix this?
Checked. It has been supported when we supported the issue "Fields used in ON condition of JOIN have an explicit alias" (issued by Robbert Jan Grootjans, 2010-10-08 03:32:31.0):) So we needn't to do more work.
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