purefreshair
MIS
Hello,
Am interested in using SQL to update a file on our AS400. The file has a description field (I'll call "desc1" that needs to be updated. I want to use a description field from a second file (I'll call "desc2") that has a description field that is up to date. Both files have other key fields from which I can join or use the where clause to perform this task. My Question(s) are:
Can use Interactive SQL, i.e. STRSQL do this?
I suspect the code would look something like the following:
Update mylib/file1
set desc1 =
(select desc2 from mylib/file2
where file1.key1 = file2.key2 and
file1.site1 = file2.site2)
.....uh, I sort of am stuck from this point. In fact, I do not know if this is the best approach.
Again, I'm a "newbie" to SQL but any help would be greatly appreciated.
Thanks.
Am interested in using SQL to update a file on our AS400. The file has a description field (I'll call "desc1" that needs to be updated. I want to use a description field from a second file (I'll call "desc2") that has a description field that is up to date. Both files have other key fields from which I can join or use the where clause to perform this task. My Question(s) are:
Can use Interactive SQL, i.e. STRSQL do this?
I suspect the code would look something like the following:
Update mylib/file1
set desc1 =
(select desc2 from mylib/file2
where file1.key1 = file2.key2 and
file1.site1 = file2.site2)
.....uh, I sort of am stuck from this point. In fact, I do not know if this is the best approach.
Again, I'm a "newbie" to SQL but any help would be greatly appreciated.
Thanks.