Page 1 of 1

unidac expression field

Posted: Wed 30 Nov 2016 12:34
by albourgz
Unidac 6.4.16, c++ builder xe10 seattle pro, vcl win32. Connected to oracle.
Qgetseq is a TUniQuery *.
QgetseqF is a TField *.

Code: Select all

Qgetseq->SQL->Text="SELECT theseq.nextval as seq from dual";
if (!Qgetseq->Prepared) {
        Qgetseq->Prepare();
        QgetseqF=Qgetseq->Fields->Fields[0];
}
I get an exception on QgetseqF=Qgetseq->Fields->Fields[0];
This is due to the fact it is a sequence: if sql->Text is

Code: Select all

SELECT  SUM(todo*Multiplicity) as tottodo, SUM(done*Multiplicity) as totdone
FROM BatchState
WHERE IDGroup=:1
then I can use QgetseqF=Qgetseq->Fields->Fields[0];

Any hint?

Re: unidac expression field

Posted: Fri 02 Dec 2016 10:39
by AlexP
Both queries lead to an error in UniDAC, as well as in other components

Re: unidac expression field

Posted: Fri 02 Dec 2016 13:21
by albourgz
Sorry, but problem seems to be a regression between unidac 6.4.15 and unidac 6.4.16.
In 6.4.15, this worked:

Code: Select all

GetBatchGroupCounts->Prepare();
TField *f1=GetBatchGroupCounts->FieldByName("TOTTODO");
TField *f2=GetBatchGroupCounts->FieldByName("TOTDONE");
After Prepare() in 6.4.15, the fields array was filled in by Prepare() and FieldByName worked.
After Prepare() in 6.4.16, the fields array is empty (GetBatchGroupCounts->Fields->Count=0) and FieldByName raises an exception!!!! Fields Array is now filled in only after open.

Re: unidac expression field

Posted: Mon 05 Dec 2016 12:44
by AlexP
The behavior is similar in both versions, maybe you created the Persistent fields in Design time or Dataset was already opened. Please send a full sample to support*devart*com where after calling prepare no error occurs when accessing fields