Page 1 of 1

Use of "Fields Editor", Detaildatas per join or "Fields ed."

Posted: Mon 21 Feb 2011 09:32
by norwegen60
Hello together,

I changed from ADO to UniDac and have now some general questions.

Is there a performance advantage/disadvantage by using the "Fields Editor". I can

Code: Select all

select * from table
and select some columns with the Fields Editor and have acces to the datas with

Code: Select all

TableNo.Value = 'test';
or

Code: Select all

select ID, No, Name from table
and get acces with

Code: Select all

Table.fieldByname('No').Value='test'
without using the "fields editor". What is more efficient

Which is the faster way to show Detaildatas

Code: Select all

select D.ID, D.No, S.Adress
from Table1 D 
left outer join Table2 S on S.ID=D.SupplierID
or to define a fkLookUp-field in "Fields Editor" under use of a second UniQuery as LookupDataset.

At the time I use only MsSQL but for the future it is also planed to use MySQL and Firebird

best regrads
Gerd

Posted: Mon 21 Feb 2011 13:11
by AndreyZ
Hello,

You can use persistent fields in both cases, but more efficient way is to use this code

Code: Select all

select ID, No, Name from table
because in this case only needed data is fetched from the server. In this case you can get more performance if you use the following code to access data:

Code: Select all

Table.Fields[1].AsString := 'test';
The faster way to show master/detail data is to use the code, because in this case the query is executed once. When you establish master/detail relationship with two Query components, detail dataset performs query each time a record is selected in the master dataset.

Posted: Mon 21 Feb 2011 13:42
by norwegen60
Many thanks for the fast feedback.

I forgot to ask espacialy for the third way

Code: Select all

select ID, No, Name from table
and "Fields Editor" with later acces over

Code: Select all

TableNo.AsString := 'test';
With master/detail I thought this, but I wasn't shure if there isn't a special handling in the component

Thanks Gerd

Posted: Mon 21 Feb 2011 15:38
by AndreyZ
You can use two approaches:
1) without persistent fields and using the following code: Table.Fields[1].AsString := 'test';
2) with persistent fields and using the following code: TableNo.AsString := 'test';
The performance will be the same in both cases.