[loadOriginal]
select fnc_load_basv1050(:s_id, ':hin_cd')

[updateOriginal]
select fnc_update_basv1050(:s_id)

[doDelete]
select fnc_delete_basv1050(':hin_cd', ':login_id')


[existoHin]
Select
 hin_cd
 ,hin_nm
from
 m_hin
where 
 del_flg = '0'
and
 hin_cd = ':ohin_cd'

[existoHin2]
Select
 hin_cd
from
 m_sethin
where 
 del_flg = '0'
and
 hin_cd = ':ohin_cd'
order by
 chin_cd


[existoSetId]
select hin_cd from m_hin
where hin_cd != ':ex_hin_cd'
and (sethin_id = ':ex_sethin_id' and ':ex_sethin_id' != '')
;

[DelOHin_Cd]
delete 
from m_sethin
where hin_cd = ':ohin_cd'

[deleteRecord]
delete from w_basv1050_copy
where s_id = :s_id
;

[insertRecord]
insert into w_basv1050_copy
(s_id, hin_cd, row_no, chin_cd, set_su, del_flg, cre_id, cre_time, 
	upd_id, upd_time)
values(:s_id, ':w_hin_cd', ':w_row_no', ':w_chin_cd', :w_suryo, 0, ':login_id', now(), ':login_id', now());


[updateRecord]
delete from m_sethin
USING w_basv1050_copy
where m_sethin.hin_cd = w_basv1050_copy.hin_cd
and w_basv1050_copy.s_id = :s_id
;

insert into m_sethin 
select hin_cd, row_no, chin_cd, set_su, del_flg, cre_id, 
	cre_time, upd_id, upd_time
from w_basv1050_copy
where s_id = :s_id
;
