Hallo Team,
I have a problem with this code (It's an example)
Close Tables all
Create Cursor crsA (key c(1), value n(5))
Insert into crsA (key, value) values ("a",1)
Insert into crsA (key, value) values ("b",1)
Insert into crsA (key, value) values ("c",1)
Insert into crsA (key, value) values ("a",1)
Insert into crsA (key, value) values ("c",1)
Create Cursor crsB (key c(1), total n(5))
Insert into crsB (key) select dist key from crSA
Update crsB set ;
total = crsB.total + crsA.value ;
from crsA ;
where crsA.key = crsB.key
The expected result should be:
a 2
b 1
c 2
but it's not.
This is the result:
a 1
b 1
c 1
Any idea?
Thanks
I have a problem with this code (It's an example)
Close Tables all
Create Cursor crsA (key c(1), value n(5))
Insert into crsA (key, value) values ("a",1)
Insert into crsA (key, value) values ("b",1)
Insert into crsA (key, value) values ("c",1)
Insert into crsA (key, value) values ("a",1)
Insert into crsA (key, value) values ("c",1)
Create Cursor crsB (key c(1), total n(5))
Insert into crsB (key) select dist key from crSA
Update crsB set ;
total = crsB.total + crsA.value ;
from crsA ;
where crsA.key = crsB.key
The expected result should be:
a 2
b 1
c 2
but it's not.
This is the result:
a 1
b 1
c 1
Any idea?
Thanks