FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour ADO RDD xHarbour
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM

Re: ADO RDD xHarbour

Posted: Tue May 12, 2015 11:44 AM
Antonio,

AHF wrote:Can it work like this?

index on &( MyFunc( myparams ) ) TO TEMP1 FOR &( MyFunc2( myparams ) )


No, as "myparams" can be a field name. It has to be completely dynamic.

EMG
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM

Re: ADO RDD xHarbour

Posted: Tue May 12, 2015 01:04 PM
Enrico Maria Giordano wrote:Antonio,

AHF wrote:Can it work like this?

index on &( MyFunc( myparams ) ) TO TEMP1 FOR &( MyFunc2( myparams ) )


No, as "myparams" can be a field name. It has to be completely dynamic.

EMG


Enrico,

But what do these functions return? The first Field expression and 2nd cfor expression or the eval result ?
Regards

Antonio H Ferreira
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM

Re: ADO RDD xHarbour

Posted: Tue May 12, 2015 03:18 PM
Antonio,

AHF wrote:But what do these functions return? The first Field expression and 2nd cfor expression or the eval result ?


As an example:

Code (fw): Select all Collapse
INDEX ON UPPER( FIELD -> name ) TO MYINDEX FOR UPPER( FIELD -> name ) = "A"


But please note that UPPER() is only a sample. Another example:

Code (fw): Select all Collapse
INDEX ON GETTOTALINCOME( FIELD -> id ) TO MYINDEX FOR GETTOTALINCOME( FIELD -> id ) >= 1000


EMG
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM

Re: ADO RDD xHarbour

Posted: Tue May 12, 2015 03:38 PM
Enrico,

Code (fw): Select all Collapse
INDEX ON UPPER( FIELD -> name ) TO MYINDEX FOR UPPER( FIELD -> name ) = "A"


This works. All you have to do is to replace UPPER with SQL UCASE or other SQL equivalent.

Code (fw): Select all Collapse
INDEX ON UPPER( FIELD -> name ) TO MYINDEX FOR "UCASE("+ FIELD -> name +")" = "A"


This should work also like this:

Code (fw): Select all Collapse
INDEX ON &(GETTOTALINCOME( FIELD -> id )) TO MYINDEX FOR &(GETTOTALINCOME( FIELD -> id ))+ ">= 1000"
Regards

Antonio H Ferreira
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM

Re: ADO RDD xHarbour

Posted: Tue May 12, 2015 04:13 PM

Antonio,

And how we define such indexes on the commands fro ADORDD.

Thanks.

Muchas gracias. Many thanks.



Un saludo, Best regards,



Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producci贸n]



Implementando MSVC 2010, FWH64 y ADO.



Abandonando uso xHarbour y SQLRDD.
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM

Re: ADO RDD xHarbour

Posted: Tue May 12, 2015 04:14 PM

Antonio,

this would mean to review all my code and I can't afford it.

EMG

Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM

Re: ADO RDD xHarbour

Posted: Tue May 12, 2015 04:38 PM
lucasdebeltran wrote:Antonio,

And how we define such indexes on the commands fro ADORDD.

Thanks.


Lucas,

Replace it in every place such as:

Code (fw): Select all Collapse
IF RDDNAME() = "ADORDD"
   INDEX ON ...
ELSE
   INDEX ON as it is 
ENDIF


Or maybe you can include a command change in INDEX ON... to foresee this situation.

I dont have such a problem because this app already works with ADS.
Regards

Antonio H Ferreira
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM

Re: ADO RDD xHarbour

Posted: Tue May 12, 2015 10:03 PM

Antonio,

No, sorry, I ment about SET ADO TABLES INDEX LIST TO <array> and SET ADODBF TABLES INDEX LIST TO commands for such indexes.

Thank you.

Muchas gracias. Many thanks.



Un saludo, Best regards,



Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producci贸n]



Implementando MSVC 2010, FWH64 y ADO.



Abandonando uso xHarbour y SQLRDD.
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM

Re: ADO RDD xHarbour

Posted: Wed May 13, 2015 08:48 AM
lucasdebeltran wrote:Antonio,

No, sorry, I ment about SET ADO TABLES INDEX LIST TO <array> and SET ADODBF TABLES INDEX LIST TO commands for such indexes.

Thank you.


Lucas,

I didnt tried I dont have such case.
Regards

Antonio H Ferreira
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM

Re: ADO RDD xHarbour

Posted: Wed May 13, 2015 11:54 AM

Antonio,

Im having a problem with APPEND FROM and COPY TO due to the fact that the scope info array never delivers cForExp and cWhileExp only the code blocks!

This disable us to construct the INSERT INTO with WHERE clause.

Is there any way to get these as literal expressions?

Regards

Antonio H Ferreira
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM

Re: ADO RDD xHarbour

Posted: Wed May 13, 2015 05:16 PM

Antonio,

I mean, for Enrico麓s indexes if you could clarify what SET ADO TABLES INDEX LIST TO ... and SET ADODBF TABLES INDEX LIST TO ... should be.

Their usage is not clear neither in source code nor readme.txt.

Thank you.

Muchas gracias. Many thanks.



Un saludo, Best regards,



Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producci贸n]



Implementando MSVC 2010, FWH64 y ADO.



Abandonando uso xHarbour y SQLRDD.
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM

Re: ADO RDD xHarbour

Posted: Wed May 13, 2015 05:36 PM

Lucas,

SET ADO TABLES INDEX LIST TO = indexes without of any clipper like expression only to be used by SQL

SET ADODBF TABLES INDEX LIST TO = indexes with the clipper like expressions needed by the app for its evaluations.

When we use &(indexkey(0)) we cant evaluate a index expression in ADO TABLES "name+dDate+nValue" we will get an error but we can issues a sql select like that.
Thus we need the ADODBF expression "name+DTOS(dDate)+STR(nValue) to do it.

The ADO indexes are for queries the ADODBF are for the normal clipper expressions to allow its evaluation.

Concerning the kind of Enrico indexes since the params are dynamic I assume that they are dynamically created each time they are needed so they dont need to be present in these arrays.

Im finishing APPEND FROM and COPY TO guessing and testing params because the doc its none.
I hope to have it ready tomorrow and Ill post a new version with all NORMAL rdd routines working.

Regards

Antonio H Ferreira
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM

Re: ADO RDD xHarbour

Posted: Wed May 13, 2015 07:30 PM

Antonio,

Thank you.

Have you checked out arrayrdd source code?.

Muchas gracias. Many thanks.



Un saludo, Best regards,



Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producci贸n]



Implementando MSVC 2010, FWH64 y ADO.



Abandonando uso xHarbour y SQLRDD.
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM

Re: ADO RDD xHarbour

Posted: Wed May 13, 2015 08:18 PM
Lucas,

Have you checked out arrayrdd source code?.


Yes but find nothing concerning append or copy.
Regards

Antonio H Ferreira
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM

Re: ADO RDD xHarbour

Posted: Thu May 14, 2015 05:31 PM

Completed version adordd at https://github.com/AHFERREIRA/adordd.git

Regards

Antonio H Ferreira