Page 36 of 70

Re: ADO RDD xHarbour

PostPosted: Tue May 12, 2015 11:44 am
by Enrico Maria Giordano
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

Re: ADO RDD xHarbour

PostPosted: Tue May 12, 2015 1:04 pm
by AHF
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 ?

Re: ADO RDD xHarbour

PostPosted: Tue May 12, 2015 3:18 pm
by Enrico Maria Giordano
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: Select all  Expand view
INDEX ON UPPER( FIELD -> name ) TO MYINDEX FOR UPPER( FIELD -> name ) = "A"


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

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


EMG

Re: ADO RDD xHarbour

PostPosted: Tue May 12, 2015 3:38 pm
by AHF
Enrico,

Code: Select all  Expand view
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: Select all  Expand view
INDEX ON UPPER( FIELD -> name ) TO MYINDEX FOR "UCASE("+ FIELD -> name +")" = "A"


This should work also like this:

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

Re: ADO RDD xHarbour

PostPosted: Tue May 12, 2015 4:13 pm
by lucasdebeltran
Antonio,

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

Thanks.

Re: ADO RDD xHarbour

PostPosted: Tue May 12, 2015 4:14 pm
by Enrico Maria Giordano
Antonio,

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

EMG

Re: ADO RDD xHarbour

PostPosted: Tue May 12, 2015 4:38 pm
by AHF
lucasdebeltran wrote:Antonio,

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

Thanks.


Lucas,

Replace it in every place such as:

Code: Select all  Expand view

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.

Re: ADO RDD xHarbour

PostPosted: Tue May 12, 2015 10:03 pm
by lucasdebeltran
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.

Re: ADO RDD xHarbour

PostPosted: Wed May 13, 2015 8:48 am
by AHF
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.

Re: ADO RDD xHarbour

PostPosted: Wed May 13, 2015 11:54 am
by AHF
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?

Re: ADO RDD xHarbour

PostPosted: Wed May 13, 2015 5:16 pm
by lucasdebeltran
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.

Re: ADO RDD xHarbour

PostPosted: Wed May 13, 2015 5:36 pm
by AHF
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.

Re: ADO RDD xHarbour

PostPosted: Wed May 13, 2015 7:30 pm
by lucasdebeltran
Antonio,

Thank you.

Have you checked out arrayrdd source code?.

Re: ADO RDD xHarbour

PostPosted: Wed May 13, 2015 8:18 pm
by AHF
Lucas,

Have you checked out arrayrdd source code?.


Yes but find nothing concerning append or copy.

Re: ADO RDD xHarbour

PostPosted: Thu May 14, 2015 5:31 pm
by AHF
Completed version adordd at https://github.com/AHFERREIRA/adordd.git