update a field from a file with a field from a selection from two files
70 pts.
0
Q:
update a field from a file with a field from a selection from two files
Hi!

When I try this:
update fileD d set d.value = (select c.value from (select b.key, b.value from fileB b where b.key not in (select a.key from fileA a)) c where d.key = c.key)
I get the message "Null values not allowed in column or variable VALUE."

on the other hand, when I do this selection:

(select c.value from (select b.key, b.value from fileB b where b.key not in (select a.key from fileA a)) c)

I get 46 records (value).

Any hint...?

Thanks in advance.
Eduardo
ASKED: Apr 29 2008  11:03 AM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
70 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
Hi again!

I already have the answer (I'll just use the real files and fields). Goes like this:

update FCONTF A set VALCOM = (select sum(CMCOMI) from FMCM000FEN
where CMNDOS = A.CONCON and CMNDOS not in (select CMNDOS from FMCM000F) group by CMNDOS)
where exists (select distinct CMNDOS from FMCM000FEN
where CMNDOS = A.CONCON and CMNDOS not in (select CMNDOS from FMCM000F))
Last Answered: Apr 29 2008  5:03 PM GMT by Mr.   70 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



0