update afm031 set
    cugdcd 	= :cugdcd,
	medcd 	= :medcd,
	cugdde  = :cugdde,
	cvsno  = :cvsno,
	ijan    = :ijan,
	cuchgcd = :chgcd
where cucd=:cucd
 and cugdcd = :orgcugdcd
 and nvl(medcd,'NULL')=nvl(:orgmedcd,'NULL')
 and nvl(cugdde,'NULL')=nvl(:orgcugdde,'NULL')
 and gdflg = '1'