I have downloaded the trial version of HXTT DBF v2.1 to evaluate its potential working alongside our VFP6.0 programs. Everything looked fine until I tried to open a table indexed on the field FROM using the SELECT command. The Exception thrown is:
java.sql.SQLException: Can't parse index expression from
at com.hxtt.global.SQLState.SQLException(Unknown Source)
at com.hxtt.sql.dbf.v.a(Unknown Source)
at com.hxtt.sql.dbf.b.for(Unknown Source)
at com.hxtt.sql.dbf.b.(Unknown Source)
at com.hxtt.sql.dbf.b.a(Unknown Source)
at com.hxtt.sql.dbf.DBFIndex.a(Unknown Source)
at com.hxtt.sql.dbf.DBFIndex.(Unknown Source)
at com.hxtt.sql.dbf.DBFIndex.a(Unknown Source)
at com.hxtt.sql.dbf.i.a(Unknown Source)
at com.hxtt.sql.dbf.d.a(Unknown Source)
at com.hxtt.sql.dbf.d.(Unknown Source)
at com.hxtt.sql.dbf.u.a(Unknown Source)
at com.hxtt.sql.a7.if(Unknown Source)
at com.hxtt.sql.cm.a(Unknown Source)
at com.hxtt.sql.cm.a(Unknown Source)
at com.hxtt.sql.a7.a(Unknown Source)
at com.hxtt.sql.a7.a(Unknown Source)
at com.hxtt.sql.y.a(Unknown Source)
at com.hxtt.sql.y.a(Unknown Source)
at com.hxtt.sql.y.executeQuery(Unknown Source)
at DBTest.getAlias(DBTest.java:46)
the offending line in DBTest.java is String sqlRead = "SELECT * FROM emailout"
when the index is removed the command works, but when I try to execute the query:
String sqlRead = "SELECT * FROM emailout WHERE emailout.from = 'xxxxx'"
the following exception is thrown
java.sql.SQLException: Failed to parse: Stopped parse at from
at com.hxtt.global.SQLState.SQLException(Unknown Source)
at com.hxtt.a.b.a(Unknown Source)
at com.hxtt.a.b.a(Unknown Source)
at com.hxtt.a.b.f(Unknown Source)
at com.hxtt.sql.a7.k(Unknown Source)
at com.hxtt.sql.y.if(Unknown Source)
at com.hxtt.sql.y.a(Unknown Source)
at com.hxtt.sql.y.executeQuery(Unknown Source)
at DBTest.getAlias(DBTest.java:46)
Is there any way round this problem as we are interested in this product.
|
Yeah. Because from is a SQL reserved word. You can try
SELECT * FROM emailout WHERE emailout."from" = 'xxxxx'
Or
SELECT * FROM emailout WHERE emailout.[from] = 'xxxxx'
If you have many tables with from column, we can supports it in sql. The HXTT DBF supports using DATE, TIME, TIMESTAMP, GROUP, ORDER, KEY, DESC, SEQUENCE, INCREMENT, MINVALUE, MAXVALUE, CACHE, CHECK, CYCLE, OTHER, SET, INT, and UPDATE directly in SQL now, although they're reserved words too.
|
Thanks for the quick response.
It has sorted the problem.
|