Form介面同一時間段中相同型別的資料不能同時啟用

2021-06-19 11:26:54 字數 2005 閱讀 8882

一、與資料庫表中進行對比看能否插入或更改:

**實現:

1、編寫檢查重複時間段的package:

procedure check_date is

v_start_date date;

v_end_date date;

v_count number;

cursor accrual_date_cur

is select a.start_date,

a.end_date

from cux_fin_ce_fund_accruals a

where a.balance_type_code = :cux_fund_accruals_l.balance_type_code

and a.accrual_category = :cux_fund_accruals_l.accrual_category

and a.enable_flag = 'y'

and a.rowid != :cux_fund_accruals_l.row_id;--cursor中需要排除當前需要新增或者修改的這一行記錄

begin

v_count := 0;

for accrual_date_rec in accrual_date_cur loop

v_start_date := accrual_date_rec.start_date;

v_end_date := accrual_date_rec.end_date;

--輸入結束日期和資料庫結束日期都不為空

if :cux_fund_accruals_l.end_date is not null and v_end_date is not null then

if nvl(v_start_date,sysdate) <= :cux_fund_accruals_l.end_date

and v_end_date >= nvl(:cux_fund_accruals_l.start_date,sysdate)

then

--fnd_message.debug('ok');

v_count := v_count+1;

exit;

end if;

--輸入結束日期為為空

elsif :cux_fund_accruals_l.end_date is null then

if nvl(v_end_date,sysdate) >= nvl(:cux_fund_accruals_l.start_date,sysdate)

then

--fnd_message.debug('ok2');

v_count := v_count+1;

exit;

end if;

--資料庫結束日期為空時

elsif v_end_date is null then

if nvl(:cux_fund_accruals_l.end_date,sysdate) >= nvl(v_start_date,sysdate)

then

--fnd_message.debug('ok3');

v_count := v_count+1;

exit;

end if;

--都為空時

elsif v_end_date is null and :cux_fund_accruals_l.end_date is null

then

v_count := v_count+1;

exit;

end if;

end loop;

if v_count > 0 then

fnd_message.debug('同一時間段中的資金型別和費率型別不能相同');

raise form_trigger_failure;

end if;

end check_date;

2、在塊級trigger:on-insert、on-update中呼叫;

彙總同一時間段的資料 位元組跳動面試高頻演算法題彙總

眾所周知,位元組跳動面試非常喜歡考演算法題。我這次彙總了牛客上7.28日 10.23日的389篇位元組跳動面經,共涉及207道leetcode程式設計題,希望本篇文章可以為大家指明乙個複習方向,幫助大家更有針對性地準備面試。結果顯示,位元組跳動最愛考察的題目是無重複字元的最長子串,共被考過25次。其...

列印最新同一時間的日誌資訊

有如下的日誌 var log message.log,要求把最新時間的日誌列印出來。1 2 3 4 5 6 7 8 9 10 time,entity,severity,node,desc 00 00 01 04 25 2016,node,info,0,img control link is up 0...

查詢一時間段內的月份

查詢某一時間段內的所有月份,可以 如下 方法一 declare date1 varchar 10 date2 varchar 10 set date1 2010 01 01 set date2 2010 12 01 select convert varchar 7 cast ltrim year d...