select a.ijan,a.gdhtun,a.gdcls9,b.scls5 gdcls9nm,
       a.gdjnm,a.gdcnum,a.gdbnum,a.gdcls7,a.gdstp,a.undkbn
from afm90 b, afm02 a
where b.cls(+)='6' and a.gdcls9=b.scls1(+)
     and a.ijan=:ijan
     