[getAnswerRirekiSeq] select w.rireki_seq as last_rireki_seq from w_basv0210_cont w where w.s_id = :parent_s_id and w.nonyu_ymd != '' and not exists ( select 1 from w_basv0210_cont w2 where w2.s_id = w.s_id and w2.rireki_seq > w.rireki_seq ) order by w.rireki_seq desc limit 1 [loadWork] select w.kibo_nonyu_ymd_kind , w.kibo_nonyu_stt_ymd , w.kibo_nonyu_end_ymd , w.nonyu_ymd_kind , w.nonyu_ymd , w.konpo_keijyo , w.konpo_biko , w.unchin_kind1 , w.unchin_kind2 , w.unchin , w.kibo_comment , w.mitsu_kigen_ymd , w.ans_comment from w_basv0210_cont w where w.s_id = :parent_s_id and w.rireki_seq = :rireki_seq [insertWork] --最新の回答レコードを消す delete from w_basv0210_cont w where w.s_id = :parent_s_id and w.nonyu_ymd != '' and not exists ( select 1 from w_basv0210_cont w2 where w2.s_id = w.s_id and w2.rireki_seq > w.rireki_seq ) ; insert into w_basv0210_cont ( s_id , rireki_seq , nonyu_ymd , konpo_biko , unchin_kind1 , unchin_kind2 , unchin , mitsu_kigen_ymd , ans_comment , biko1 , biko2 , cre_time_s , reg_flg , del_flg , cre_id , cre_time , upd_id , upd_time ) values ( :parent_s_id , (select COALESCE(max(rireki_seq),-1) + 1 from w_basv0210_cont where s_id = :parent_s_id) , ':nonyu_ymd' , ':konpo_biko' , ':unchin_kind1' , ':unchin_kind2' , :unchin , ':mitsu_kigen_ymd' , ':ans_comment' , 'Answer' --biko1 , 'ETD JAPAN '||':nonyu_ymd' --biko2 , to_char(now(),'yyyy/mm/dd hh24:mi') --cre_time_s , 0 --reg_flg , 0 --del_flg , ':login_id' --cre_id , now() --cre_time , ':login_id' --upd_id , now() --upd_time ); [__GOMI] , kibo_nonyu_ymd_kind , kibo_nonyu_stt_ymd , kibo_nonyu_end_ymd , nonyu_ymd_kind , konpo_keijyo