BEGIN
Update RSC_SYS_DAYPART_SETUP 
Set DAYPART_NAME = #daypartName#,
FROMTIME = #fromtime#, TOTIME = #totime#, 
DAYPART_TYPE = #daypartType# 
Where DAYPART_ID = #daypartId#
IF sql%rowcount = 0 THEN
Insert Into RSC_SYS_DAYPART_SETUP (DAYPART_NAME,
FROMTIME, TOTIME, DAYPART_TYPE)
Values (#daypartName#, #fromtime#, #totime#,
#daypartType#);
END IF;
END;