Fast reading?
Thomas Flemming
tf at ttqv.com
Sat Apr 10 07:21:05 CDT 2010
Hi Ruslan,
Am 10.04.2010 12:05, schrieb Ruslan Zasukhin:
> On 4/10/10 12:48 PM, "Thomas Flemming"<tf at ttqv.com> wrote:
>
>> Its not filling another table, I just need them into a .net-object/variable.
>> And so I'm doing
>>
>> for i =0 to cursor.recordcount
>> cursor.Position = i
>> f(i).a1 = cursor.fields("f1").value
>> f(i).a2 = cursor.fields("f2").value
>> f(i).a3 = cursor.fields("f3").value
>> next
>>
>>
>> I had the same problem, when writing the data into the table:
>> for i =0 to f.count
>> table.setblank
>> table.fields("f1").value = f(i).a1
>> table.fields("f2").value = f(i).a2
>> table.fields("f3").value = f(i).a3
>> table.addrecord
>> next
>>
>> which was also quiet slow, but this could be solved with data binding, which
>> is much faster:
>
> Do you work with LOCAL db or REMOTE ?
Its all local, no server.
my table has 10 fields, one call to
SqlExecute("INSERT INTO [mytable] (f1, f2,..,f10)
VALUES ( :1, :2,..,:10)", myarray)
is much faster then 10x table.fields(i).value = f(i).a1
Tom
>
> SQL and binding can be faster only for vserver ...
>
>
>> SqlExecute("INSERT INTO [mytable] (f1, f2,..,fx)
>> VALUES ( :1, :2,..,:x)", myarray)
>>
>> So I was hoping that there is also something with data binding to read a whole
>> record quickly into a .net-object/variable
>
> If you work with vserver, then I think you use Server side cursor
>
> Try to use client side cursor, it is faster.
>
> Client side is good choice if you only read, and selection is not huge
>
--
/****************************************
** Dipl.-Ing. Thomas Flemming
** Software Development
**
** Touratech AG
** Auf dem Zimmermann 7-9
** D-78078 Niedereschach
**
** mail tf at ttqv.com
** fon +49 (0) 7728 9279-206
** fax +49 (0) 7728 9279-29
**
** http://www.ttqv.com
** http://www.touratech.de
**
** ... und immer dem Pfeil nach!
***************************************/
More information about the Valentina
mailing list