for i = 1 to ll_rowcount
luo_customerProfiles[i].effectiveDate =
lds_accountProfileTemp.getItemDateTime(i, 'efectiveDate')
next
I know I can get all the elements from the datastore quickly into an array
using dot notation:
datetime ll_effective[]
ll_effective = lds_accountProfileTemp.object.effectiveDate.Primary
I just can't figure our how to tie it all together:
-- This doesn't work:
luo_customerProfile[].effectiveDate = ll_effective[]
Hope this pseudo code is enough info; I didn't write the code. Need some
speed increase without a redesign. This structure can have a lot of
elements, and there are a lot more columns than just effectiveDate.
Thanks for any help.
- Steve
If the structure has the same column order and number of fields you
can use this syntax:
luo_customerProfiles=lds_accountProfileTemp.object.data
For i=upperbound(ll_effective[]) To 1 Step -1
luo_customerProfile[i].effectiveDate = ll_effective[i]
Next
In article <470e8e3a$1@forums-1-dub>, no...@nothere.com says...
> luo_customerProfile[].effectiveDate = ll_effective[]
>
ll_rowcount = lds_datastore.retrieve()
for i = 1 to ll_rowcount
luo_customerProfiles[i].effectiveDate = lds_datastore.getitem(i,
'effectiveDate')
luo_customerProfiles[i].terminationDate = lds_datastore.getitem(i,
'terminationDate')
etc....
next
I was hoping there might be a way to somehow populate all effectiveDates and
terminationDates without looping. Something like:
luo_customerProfiles[].effectiveDate =
lds_datastore.object.effectiveDate.Primary
luo_customerProfiles[].terminationDate =
lds_datastore.object.terminationDate.Primary
I don't think I can do this, so I'm probably looking at a complete rewrite.
Which is fine, it need its.
Thanks again,
Steve
luo_customerProfile.object.effectiveDate.Primary = ll_effective
Paul Horan[TeamSybase]
"Steve" <no...@nothere.com> wrote in message news:470e8e3a$1@forums-1-dub...
I have often seen improved performance when I have applications like
this by compiling these to "Machine code" not P-Code which is the default.
Also, might I suggest:
1) Allocate your array in contiguous memory.
Example:
uo_data[] io_data
ll_rows = DS.RowCount()
io_data[ll_rows]= Create uo_data
2) Now loop through your load in descending order ( this is much more memory
effective).
OR
Use another DataStore instead of the UO array and use the "Dot" notation to
load the new DS with the current buffer data!
Food for thought.
Regards ... Chris
"Steve" <no...@nothere.com> wrote in message news:4713ab2b@forums-1-dub...
datetime ll_effective[]
// All column data into array
ll_effective = lds_accountProfileTemp.object.effectiveDate.Primary
// Transfer to uo array elements
For i=upperbound(ll_effective[]) To 1 Step -1
luo_customerProfile[i].effectiveDate = ll_effective[i]
Next
=> i would still expect approach 2 to be faster.. depending on volume of data
but the best way is -as Philip indicated- to make a structure for the dw column definition
(matching datatype & order) and fill an array of that with data, if that suits your
intentions. see example below.
HTH,
Ben
example:
global type str_dwdata from structure
string identification
...
datetime effectiveDate
datetime terminationDate
end type
...
str_dwdata lstr_data[]
// Copy all data into structure
lstr_data = lds_accountProfileTemp.object.data
In article <4713ab2b@forums-1-dub>, no...@nothere.com says...
- Steve