CREATE OR REPLACE FUNCTION delete_r_seikyu()
  RETURNS trigger AS $$
begin
insert into dat_rd_seikyu (
    rirekino
,sakujofg
    , seikyuno
    , tokuisakicd
    , shimebi
    , seikyubi
    , nyukinyoteibi
    , seikyugaku
    , hikazeikingaku
    , shohizeiritsu1
    , kazeitaishogaku1
    , shohizeigaku1
    , shohizeiritsu2
    , kazeitaishogaku2
    , shohizeigaku2
    , maeukeseikyugaku
    , biko
    , shanaibiko
    , shoninnichiji
    , shoninshaid
    , insatsukaisu
    , sakuseiuserid
    , sakuseinichiji
    , koshinuserid
    , koshinnichiji
) values (
nextval('sqns_seikyurirekino')
,true
    , old.seikyuno
    , old.tokuisakicd
    , old.shimebi
    , old.seikyubi
    , old.nyukinyoteibi
    , old.seikyugaku
    , old.hikazeikingaku
    , old.shohizeiritsu1
    , old.kazeitaishogaku1
    , old.shohizeigaku1
    , old.shohizeiritsu2
    , old.kazeitaishogaku2
    , old.shohizeigaku2
    , old.maeukeseikyugaku
    , old.biko
    , old.shanaibiko
    , old.shoninnichiji
    , old.shoninshaid
    , old.insatsukaisu
    , old.sakuseiuserid
    , old.sakuseinichiji
    , old.koshinuserid
    , old.koshinnichiji  );
return new;
end;
$$
LANGUAGE plpgsql;
