Gunther,
Thanks Done!
Antonio H Ferreira
Gunther,
Thanks Done!
New build adordd ver 1.0 at https://github.com/AHFERREIRA/adordd.git
New:
1) SET ADODBF INDEX LIST FIELDTYPE NUMBER TO {{ "Table",{ "numfiled", nlen },{"numfield", nLen } } }
adordd need a precise indication of the len of numeric fields used in index expressions.
This is only needed for numeric fields where the SQL type its without field len definition such as:
AUTOINC, MONEY, DOUBLE, INT, SMALLINT, etc.
Corrected Bugs:
1) ADOBEGINTRANS( nWA ) : without work are it starts a transaction in default adordd connection otherwise
it starts in the connection of the current work area.
2) ADOROLLBACKTRANS( nWA ) : without any work area it rolls back all transactions in all open connections
otherwise it rolls back transaction in same connection as that work area.
3) ado_create was adding an extra position in field len of numeric fields
now ADO_FIELDSTRUCT takes that position returning the correct len of a field type "N"
This could lead to side effects in INDEXKEY where the numeric field was part of the expression.
No tables structure corrections are necessary.
4) ADPSEUDOSEEK works now ok with fields type "T"
5) ADODUFINDEX if result of the index expression its numeric its considered as it was a UDF expression
because we cant extract field len to build a find, filter or query expression because the eval result
its the sum of all the numeric fields in the expression.
6) ORDKEYGOTO was not full implemented.
New build adordd ver 1.0 at https://github.com/AHFERREIRA/adordd.git
Corrected new Bugs due to changes previous build:
1) ADO_SQLSTRU with firebird numeric fields precision fieldlen was wrong
2) ADO_FIELDSTRUCT integers doesnt take any extra position.
3) ADO_PUTVALUE trim spaces to check data width error with numbers.
New AdoRdd Version 1.070317 at https://github.com/AHFERREIRA/adordd.git
Improvements and corrected bugs:
ADO_ORDCREATE after creating index wasnt opening it.
ADO_SEEK key with multiple fields with softseek on was going to eof instead of last key.
ADOFILE if connection not valid returns now .F. instead of HB_FAILURE.
ADOOPENCONNECT if engine its not supported or wrongly set alerts the user.
ADOBEGINTRANS if workarea not specified opens a transactions for each opened connection
ADOCOMMITTRANS and ADOROLLBACKTRANS the same as ADOBEGINTRANS
New function ADONESTEDTRANS( nWA ) returns nr of nested transactions
NEW ERROR CODE 10600 - connection not available cant find transactions
ADO_ALREADYOPEN Test if the open recordset has same Sql query statement.
ADORECCOUNT Table name was not being converted to get fieldrecno if any defined
for that table always returned that default one.
ADOPREOPENTHRESHOLD Faster counting records. Doesn't cache any tables with WHERE clause.
All ADO cursors changed in the code from adopendynamic to adopenstatic, although it always
started as adopenstatic.
New features:
New option PORT in SET ADO DEFAULT DATABASE ...
ADO_ORDINFO ordwildseek implemented
Multibag orders support with new SET:
SET ADODBF MULTIBAG INDEX LIST TO { { "INDEX NAME", {TAGORDER 1","TAGORDER2"} } }
This allows multibag index file support exactly the same as any other DBf rdd.
ATTENTION
Now when SET AUTOOPEN ON doesn't open all index files automatically in SET ADODBF INDEX LIST instead
only opens the INDEX NAME present in SET ADODBF MULTIBAG INDEX LIST TO that match the table name.
Faster opening recordsets:
SET RECORDSET OPEN WHERE CLAUSE TO { { "TABLENAME", "SQL WHERE EXPRESSION" } }
ADOWHERECLAUSE ADORDD function allowing us to change the recordset WHERE clause on the fly keeping all
workarea information as Filters, Scopes, Indexes, etc.
Ex
SET RECORDSET OPEN WHERE CLAUSE TO { { "table", "FIELDANEMYEAR = '2017'" } }
USE table
BROWSE() //only records that meet "where" clause
//we want to see some historic data
cOldQry := ADOWHERECLAUSE( SELECT(), "FIELDANEMYEAR = '2012'" )
BROWSE()
//Get back to current year
ADOWHERECLAUSE( SELECT(), cOldQry )
BROWSE()
New AdoRdd at https://github.com/AHFERREIRA/adordd.git
New AdoRdd at https://github.com/AHFERREIRA/adordd.git
....
//Ex
USE "MYTABLE" // 10.000.000 RECS with SET RECORDSET OPEN WHERE CLAUSE TO will load only 51.000 recs
....
// Here we will need other set of data
//we have to be sure that with this new query our app code can run all necessary routines
nRecno := RECNO()
cOldSql := ADOWHERECLAUSE( SELECT(), "INVOICEDATE > '2016/04/01'" )
//working with the new set
//all workarea data, indexes etc continue exactly the same
//finish working get back to previous set
ADOWHERECLAUSE( SELECT(), cOldSql )
GO nRecno
....SET ADO PRE OPEN THRESHOLD TO 0 MASK {"MYTABLE","MYTABLE2"}New AdoRdd at https://github.com/AHFERREIRA/adordd.git
Improved speed DBEval
Cache tables and recordsets enhancement
New AdoRdd and tryadordd at https://github.com/AHFERREIRA/adordd.git
My main work now with AdoRdd its database with tables between 5.000 and 10.000.000 records building recordsets between 5.000 and 100.000 records and 70 columns in average.
The work its on a 1Gb LAN.
In the bigger tables if the server has indexes for the WHERE clause its pretty fast < 3 Secs building the recordset.
The memory consumption gets to max 600Mb.
I can have > 50 recordset opened at same time.
With the cached recordsets memory consumption will not increase.
AdoRdd can cache the recordsets in the beginning of the application with:
SET ADO PRE OPEN THRESHOLD TO
In this case app waits a little more to start but then all table opening its lightning fast.
Normally to display a window with > 20 tables its less < 1sec.
If we choose not to use this SET AdoRdd will use as cache already opened tables.
Thus the second time it will be also very fast.
With tables of this dimension we absolutely need a default open WHERE clause otherwise application would crawl and crash. use SET RECORDSET OPEN WHERE CLAUSE TO.
Please pay attention to these WHERE clauses otherwise you might not be able to see new additions as soon as AdoRdd requery.
Punctuality we might need to reduce the recordset for ex for sum SUM operations.
This is where we use:
cOldSql := adowhereclause( Select(), "where clause" )
SUM ...
adowhereclause( Select(), cOldSql )
Hope this might help you.
Necesito ayuda, cuando estoy usando dos aplicaciones, cuando incluyo una, en la otra aplicación no aparece.
¿ Quien no aparece ?
no aparece el elemento que agregué en el otro sistema,
Ej: dejo ambos sistemas en la pantalla de registro de grupo con xbrowse, al incluir en un sistema, en el otro si voy a incluir el mismo código porque no actualizo el registro, y en xbrowse tampoco aparece .
Ahora cuando hago un cambio, cambia normal en ambos
REQUEST DBFCDX
REQUEST ORDKEYNO
REQUEST ORDKEYCOUNT
REQUEST ORDKEYGOTO
REQUEST ADORDD, ADOVERSION, RECSIZE
FUNCTION MAIN()
RddRegister("ADORDD",1)
RddSetDefault("ADORDD")
SET DATE TO BRIT
SET CENTURY ON
SET EPOCH TO (YEAR(DATE())-50)
SET DELETED ON
SET SOFTSEEK OFF
IF RDDSETDEFAULT() == "ADORDD"
SET ADODBF TABLES INDEX LIST TO {{"SLGRUP",{"SLGRUP1","STRZERO(GRU_COD,3)"},{"SLGRUP2","GRU_DES"}},;
{"SLSGRU",{"SLSGRU1","STRZERO(SGR_COD,3)"},{"SLSGRU2","SGR_DES"}} }
SET ADODBF MULTIBAG INDEX LIST TO {{"SLGRUP",{"SLGRUP1","SLGRUP2"}},;
{"SLSGRU",{"SLSGRU1","SLSGRU2"}} }
SET ADO TEMPORAY NAMES INDEX LIST TO {"TMP","TEMP"}
SET ADO INDEX UDFS TO {"IF","&","SUBSTR","==","DESCEND","MYFUNC","PAD"}
SET ADODBF INDEX LIST FIELDTYPE NUMBER TO { {"SLGRUP",{"GRU_COD",3}} }
//SET ADO TABLES DECIMAL FIELDS LIST TO {}
//SET ADO TABLES LOGICAL FIELDS LIST TO {};
SET ADO DEFAULT RECNO FIELD TO "ID"
//SET ADO FIELDRECNO TABLES LIST TO {{"SLGRUP","ID"}}
SET ADO DEFAULT DELETED FIELD TO "HBDELETE"
//SET ADO FIELDDELETED TABLES LIST TO {{"SLGRUP","HBDELETE"}}
SET ADO FORCE LOCK ON
SET ADO LOCK CONTROL SHAREPATH TO HB_DIRBASE()+"TEMP" RDD TO "DBFCDX"
SET ADO DEFAULT DATABASE TO "dbfnew" SERVER TO "localhost" ENGINE TO "MYSQL" USER TO "new" PASSWORD TO "123"
// with thsi set the path becomes part of the table name.
SET ADO TABLENAME WITH PATH OFF
// uploaded with one path working now with another
SET ADO ROOT PATH TO HB_DIRBASE()+"DADOS" INSTEAD OF HB_DIRBASE()
SET ADO CACHESIZE TO 100 ASYNC ON ASYNCNOWAIT ON
SET ADO PRE OPEN THRESHOLD TO 5000 //MASK { "TABLE" }
SET EXCLUSIVE OFF
SET AUTORDER TO 1
SET AUTOPEN ON
hb_AdoUpload( HB_DIRBASE()+"DADOS\" , "DBFCDX" , "MYSQL", .f. )
ENDIF
USE SLGRUP ALIAS "SLGRUP" VIA "ADORDD" NEW
USE SLSGRU ALIAS "SLSGRU" VIA "ADORDD" NEW
RETURN .T.A la luz del fuente: https://github.com/AHFERREIRA/adordd/bl ... adordd.prg quizás necesites incluir en tu codigo un SKIP 0 (refresh())