select  MATLINEID
  from QD2_MATLINEMAIN
  where MATID=in_matid; 的问题吧,检查表 QD2_MATLINEMAIN 有无 MATLINEID 或 MATID 列