Hi. I have a simple code:
The results are all records have values of csr2.exist as 1, when I thought only records of csr2.name with values A and B should have value of 1 in csr2.exist. Perhaps there is something wrong with my code, or my understanding of <>? Thank you for taking the time.
Code:
create cursor csr1 (name C(5))
insert into csr1 (name) values ("A")
insert into csr1 (name) values ("B")
insert into csr1 (name) values ("C")
insert into csr1 (name) values ("D")
insert into csr1 (name) values ("E")
create cursor csr2 (name C(5), exist N(1))
insert into csr2 (name, exist) values ("A", 0)
insert into csr2 (name, exist) values ("B", 0)
insert into csr2 (name, exist) values ("F", 0)
insert into csr2 (name, exist) values ("G", 0)
update csr2 set exist = 1 where csr2.name <> csr1.name
The results are all records have values of csr2.exist as 1, when I thought only records of csr2.name with values A and B should have value of 1 in csr2.exist. Perhaps there is something wrong with my code, or my understanding of <>? Thank you for taking the time.