declare mcount char(8); a number; begin if :iss.tray_no is null then g.dummy := g.cent('Tray No. Cannot be Blank',1,1); raise form_trigger_failure; go_item('tray_no'); end if; select count(*) into mcount from iss where rtrim(lower(tray_no)) = lower(rtrim(':iss.tray_no')) and sl_no <> :iss.sl_no; if mcount > 0 then g.dummy := g.cent('Tray No. already exists',1,1); raise form_trigger_failure; end if; a := length(':iss.tray_no'); if a != 8 then raise form_trigger_failure; end if; go_item(':iss.qty'); end;