I came across a problem with view which can be demonstrated on this example:
Table A: int a, int b
Table B: int c, int d
View view_ab: SELECT A.*, B.* FROM A LEFT JOIN B ON (A.b=B.d) AND (A.a=B.c);
HXTT Access throws an exception while executing query: SELECT * FROM view_ab
Table name B has been declared more than one time in a same statement.java.sql.SQLException: Table name B has been declared more than one time in a same statement.
Error Code:212992
SQL State:34000
at com.hxtt.global.SQLState.SQLException(Unknown Source)
at com.hxtt.sql.dc.a(Unknown Source)
...
The cause of the problem is a complex condition in 'ON' clause: (A.b=B.d) AND (A.a=B.c), because there is no error when it is changed to A.a=B.c .
Also the underlying query of the view is executed by HXTT without any problem. So, something is wrong only with views.
Is there any solution to this problem?
In this particular case I don't see any possibility to rewrite query. Moving condition to 'WHERE' clause will change the logic of LEFT JOIN
The test case is uploaded onto your ftp as view_ab.zip
Thanks in advance,
Nikita
|
Supported. That's resulted by MS Access stored two ON expressions in different place so that HXTT Access thought it's "SELECT A.*,B.* FROM (A LEFT JOIN B ON A.a=B.c) LEFT JOIN B ON A.b=B.d;" The next latest package will be release after about 48 hours.
|