hello how can i run my ntx index file into dbf file i already have a cgp file with the name of the index . and did the fonction setfetchsize(int i) work ?
|
You can read 6. The ntx can't be updated when I update the DBF file. at here. After your CGP file contains that NTX file name, you needn't to do more special operation.
ResultSet.setFetchSize() or Statement.setFetchSize() can work.
|
how to fetch data from database according to an index ?
|
It will utilize index automatically according to your where clause.
|
I have try but i don't know how to do, could you give me an example please ?
I have a dbf file named AFAIRE.DBF and an index file AFAIRED.NTX . In my dbf file i have (codint varchar, datecour date, dateinit date, real varchar, ref varchar) and my index sort the data like this codint+dtos(datecour)+real+dtos(dateinit) which are the keys.
i call the NTX file in a CGP file named AFAIRE.CGP so it's already refresh automatically the index.
when i do "SELECT * FROM AFAIRE" the index is not automatically appli and the resultSet return the data like in the database
But now i would like to fecth the data of my dbf file to sort the result with my NTX index
|
for exemple:
imagine i have 3 rows in my database:
CODINT DATECOUR DATEINIT REAL REF
zzzz 25-01-95 04-12-96 aaa aaa
aaaa 25-01-95 04-12-96 aaa aaa
bbbb 25-01-95 04-12-96 aaa aaa
when i do "SELECT * FROM AFAIRE" i get the same result in the same order but i want to use my index to have with a "SELECT * FROM AFAIRE [...]" something like this:
CODINT DATECOUR DATEINIT REAL REF
aaaa 25-01-95 04-12-96 aaa aaa
bbbb 25-01-95 04-12-96 aaa aaa
zzzz 25-01-95 04-12-96 aaa aaa
|
java.sql.SQLException: Can't parse index expression delflag()+CODINT+DTOS(DATECOUR)+REAL+DTOS(DATEINIT)
at com.hxtt.b.al.a(Unknown Source)
at com.hxtt.sql.dbf.y.a(Unknown Source)
at com.hxtt.sql.dbf.m.i(Unknown Source)
at com.hxtt.sql.dbf.m.(Unknown Source)
at com.hxtt.sql.dbf.DBFIndex.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.x.a(Unknown Source)
at com.hxtt.sql.by.if(Unknown Source)
at com.hxtt.sql.by.a(Unknown Source)
at com.hxtt.sql.d1.a(Unknown Source)
at com.hxtt.sql.dc.a(Unknown Source)
at com.hxtt.sql.by.a(Unknown Source)
at com.hxtt.sql.am.a(Unknown Source)
at com.hxtt.sql.am.if(Unknown Source)
at com.hxtt.sql.am.a(Unknown Source)
at com.hxtt.sql.am.executeUpdate(Unknown Source)
at Test.main(Test.java:25)
|
First, it will utilize index when where clause contains indexed expression, or order by indexed expression.
Secondly, delflag() is a unknown function so that HXTT DBF throws exception. You can use DELETED() or use Extend SQL functions
|