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
Table Alias remains in column name on QTY field
Andrew
2025-04-30 20:20:58
We are testing the latest DBF JAR (our previous version was from over 10 years ago!) and using the trial jar we notice that some queries are not removing the table alias prefix. For example, we have this query:

SELECT r."DATE" AS PoDate,
r.PONO AS PoNumber,
r.PO_TIME As PoTime,
r.SHIP_VIA AS ShipVia,
r.CO_NAME AS Vendor,
r.SALESMAN AS BuyerInit,
r.invno,
d.QTY,
0 AS QTY_RCV,
d.QTY AS QTY_BO,
d.COST AS Price,
d.QTY*d.COST AS ExtPrice,
IIF( ISDATE( d.REQ_DATE ),
IIF( TIMESTAMP( d.REQ_DATE ) > r.due_dat,
TIMESTAMP( d.REQ_DATE ),
r.due_dat
),
r.due_dat
) AS RequiredDate,
d."DESC" AS PartSKU,
i.descp AS Description,
false AS wasEmailed
FROM ( ( "DBF\po-rec" AS r
INNER JOIN "DBF\po-dtl" AS d
ON r.REF = d.REF )
LEFT JOIN "DBF\invent" AS i
ON d."desc" = i.itm )
WHERE d.QTY <> 0 AND r.RECEIVED <> 1 ORDER BY PoDate DESC, PoNumber DESC

The resultset keeps "d.QTY" as the returned column name instead of just "QTY" (as it did in previousl versions). I notice this happens on several quesries that have the column name "tbl_alias.QTY" so it seems there is an issue with the "QTY" as a column name?
Re:Table Alias remains in column name on QTY field
HXTT Support
2025-05-03 18:56:46
When there's a QTY column in po-rec too, HXTT DBF will reserve the table alias so that we can know that QTY is from table A or table B.
Re:Re:Table Alias remains in column name on QTY field
Andrew
2025-05-09 16:13:39
Thank you for your reply. In these cases, there is not also a QTY column in po-rec. The QTY column only exists in po-dtl. I note that these same queries did not exhibit this behavior in the older JDBC 3.0 drivers we worked on years ago.
Re:Re:Re:Table Alias remains in column name on QTY field
HXTT Support
2025-05-14 04:09:21
Passed test with the following SQL sample:



CREATE TABLE "po-rec" ( "DATE" DATE, invno INT, REF VARCHAR(16), RECEIVED INT);

CREATE TABLE "po-dtl" ( "QTY" INT, COST DECIMAL(8,2), REF VARCHAR(16), desc VARCHAR(8));

CREATE TABLE "invent" (ITEM VARCHAR(8), descp VARCHAR(16));

INSERT INTO "po-rec" VALUES(NOW(), 123, 'TOM', 2);
INSERT INTO "po-dtl" VALUES(1,65.8, 'TOM', 'Cat');
INSERT INTO "invent" VALUES('Cat', 'Tomcat');

SELECT r."DATE" AS PoDate, r.invno, d.QTY, 0 AS QTY_RCV, d.QTY AS QTY_BO, d.COST AS Price, d.QTY*d.COST AS ExtPrice, i.descp AS Description, false AS wasEmailed FROM ( ( "po-rec" AS r INNER JOIN "po-dtl" AS d
ON r.REF = d.REF ) LEFT JOIN "invent" AS i ON d."desc" = i.itm ) WHERE d.QTY <> 0 AND r.RECEIVED <> 1 ORDER BY PoDate DESC;

So maybe HXTT DBF thought that's a possible column alias confliction in your sample?


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