I am looking for the most performant and least memory use - version.
the test dataObject consists of 1700 rows and 17 columns.
The two datawindows(datastores) does not have the same dataObject. So I
first tried to copy each field from the source to the destination. the
code is show below.
FOR i=1 TO lds_dstore_source.rowcount()
FOR j=1 TO integer(lds_cust_dstore.Object.DataWindow.Column.Count)
lds_dstore_dest.Object.Data.Primary[i,j] =
ds_dstore_source.Object.data.primary[i,j]
NEXT
NEXT
the result is that it takes about 51 seconds to copy all fields to its
destination and about 18Mb of ram. !!! thats ways over the best case
!!!!
so the next attempt was to copy it row after row (just to see how this
will work.)
FOR i=1 TO lds_dstore_source.rowcount()
lds_dstore_source.rowscopy(i,i,Primary!,lds_dstore_dest,0,Primary!)
NEXT
this takes about 0.5 of a second and only 600kb of ram.
Can somebody explain this to me .?
The other thing is :
I need to use the first solution( because I dont want to copy each row
into another (because the dataObject of source and dest. is not the
same!!!).
The strange thing is that I cant reallocate this huge amount of memory
(18 Mb)
In the second try I destroy both datastores after they have been filled
and saved back. This mem is reallocate .....hm.... does anyone have the
key to this problem. ?
detlef
Description
You can access data in a range of rows and columns by specifying the
starting and ending row and column numbers.
Syntax
dwcontrol.Object.Data {.buffer } {.datasource } [ startrownum,
startcolnum, endrownum, endcolnum ]
ll_max = lds_dstore_source.rowcount()
li_count = integer(lds_cust_dstore.Object.DataWindow.Column.Count)
lds_dstore_dest.Object.Data.Primary[1,1, ll_max, li_count] =
ds_dstore_source.Object.Data.Primary[1,1, ll_max, li_count]
HTH
Simon
Detlef Brendle wrote in message <377F7DBB...@fh-konstanz.de>...
detlef
Simon
Detlef Brendle wrote in message <3780B891...@fh-konstanz.de>...
you are right - I should be dstore_source instead cust_dstore.
that was my fault .sorry - but the problem is the same...
detlef
insert into destanation_table values (col_1,col_2) (select col_1,col_2
from source_table);
?
Or was your code an example only, is your actual requirement different?
Simon
Detlef Brendle wrote in message <3780DD8E...@fh-konstanz.de>...
>hi Simon,
>
>you are right - I should be dstore_source instead cust_dstore.
>that was my fault .sorry - but the problem is the same...
>detlef
>
>Simon Caldwell wrote:
>
>> I think I'm missing something here. I was going to say that my code
>> achieved exactly the same as yours. But then I noticed that you are
copying
>> from dstore_source to dstore_dest, but getting the column count from
>> cust_dstore. Is this right?
>>
>> Simon
>>
>> Detlef Brendle wrote in message <3780B891...@fh-konstanz.de>...
adw_dest.Object.Data.Primary[ai_row_dest,ai_col_dest] =
string(adw_src.Object.data.primary[ai_row_src,ai_col_src])
and If I use columns copy
adw_dest.Object.Data.Primary[ai_row_dest,ai_col_dest,ai_maxrow,ai_maxcolumn] =
string(adw_src.Object.data.primary[ai_row_src,ai_col_src,ai_maxrow,ai_maxcolumn])
its not working because its not a single field to convert anymore.
Can I do it anyway_?
detlef
HTH,
Joe Parra