To any who are interested.... I finally got a statment to work, but I had to update the entire file. A consultant believes we have a defect in SQL/400 because both of these updates should have worked, but only one did.
FAILED:
update f4106 BP1
set bplitm =
(select IM1.imlitm from f4101 IM1...
Ahhhhh!!!! I only have one record in the F4101 file (your f101) but in some instances may have multiple records in the F4106 file (your f104). Because of that relationship does this mean I can't do this update or we just have to be more creative?? (I tried the update anyway, and it ran for...
I tried:
update f4106 set f4106.bplitm=f4101.imlitm from f4101
where f4106.bpitm = F4101.imitm
and f4106.bplitm <> F4101.imlitm
and got: Token . was not valid. Valid tokens: =.
Then I tried:
update f4106 set bplitm=imlitm from f4101
where f4106.bpitm =...
The WHERE statement in line 4 gave me a syntax error. "Token , was not valid. Valid tokens: < + ) - > = <> <= ¬< ¬> ¬= >= IN"
I removed one of the qualifiers in line 4 and 5.
4. WHERE (f4106.bplitm) not in
5. (SELECT imlitm from f4101)
The update ran and said "Null values are...
Can someone to help me with the "order of operations" with this statment. I finally got an update to work, kinda. The update ran, and said "Row not found for update." I need help knowing which statements are being looked at first, so I can figure out which row it can't...
I tried it and I got a syntax error: " Keyword FROM not expected. Valid tokens: SET." I took out the "FROM" statement and replaced it with "Set bplitm=f4101.imlitm" and got the original error "Column qualifier or table F4101 undefined." Still looking for...
Well, it acted like it was going to work, but then I got a "Null values are not allowed in column bplitm in table F4106." It went on to say: " If this is an UPDATE statement then the null value was specified in the relative entry 1 in the SET clause. The null value was specified...
Oops! That was my typo. I do have the parenthsis there. What's puzzling, is if I set my last where statement to:
Where f4106.bpitm = 1247
it works. But I don't want to have to do this update one record at a time!!!
I've seen suggestions for variations of this request, but when I tried them, it ignored my data selection and indicated it was going to update the entire file, which is NOT ok. (I only want to update the records that don't already match.) What I tried is:
update f4106
set bplitm = select (imlitm...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.