How to speed up fetching records with CtrlADO loop with dbGetField vs. dbGetResult...


Instead of fetching the records in a loop with dbEOF and dbGetField you should use the
Function dbGetResult.


The Function dbGetResult fetches the whole result, so no loop is done in WinCC OA
Control. The Function is implemented in C++, so you can imagine that it is much faster then
the interpreted WinCC OA Control Code.


Especially when you use it a lot of times and getting a lot of rows and or columns out of the
database!


You can also use functions from the library “rdb.ctl” (this library is delivered with WinCC OA).
There you can find functions like “rdbSelect(…)”. These functions are using dbGetResult and
are also easy to use.


Remark: But be careful with this function when you read millions of rows. The Function
dbGetResult returns a dyn_dyn_anytype. So the result is loaded into the memory! 

Last update:
2014-09-09 19:04
Author:
Andreas Vogler
Revision:
1.0
Average rating:0 (0 Votes)

You cannot comment on this entry

Chuck Norris has counted to infinity. Twice.