39: l_sysdate DATE :=trunc(sysdate);
40:
41: cursor BATCH is
42: select XTR_BATCHES_S.NEXTVAL
43: from DUAL;
44:
45: cursor BATCH_EXIST is
46: select 1
47: from XTR_BATCHES
50: l_exist number;
51:
52: cursor NUM is
53: select XTR_REVALUATION_DETAILS_S.NEXTVAL
54: from DUAL;
55:
56: -- Get Volatility (O, V) rows from Market Price table
57: cursor OPTION_VOLS is
58: select RIC_CODE, CURRENCY_A, CURRENCY_B, TERM_TYPE, TERM_LENGTH,
9871:
9872:
9873: begin
9874: select XTR_REVALUATION_DETAILS_S.NEXTVAL
9875: into l_reval_detail_id from DUAL;
9876:
9877: -- we consider the deal is complete if all FV P/L and currency G/L has been derived
9878: if rec.fair_value is not null and currency_gl is not null
9879: and p_hedge_flag is NULL then
10056: for update of FIRST_REVAL_BATCH_ID NOWAIT;
10057:
10058: begin
10059: select XTR_REVALUATION_DETAILS_S.NEXTVAL
10060: into l_reval_detail_id from DUAL;
10061:
10062: -- we consider the deal is complete if all FV P/L and currency G/L has been derived
10063: if rec.fair_value is not null and currency_gl is not null then
10064: l_complete := 'Y';
10189: Close CHK_BATCH_RUN;
10190:
10191: -- insert new row to XTR_BATCH_EVENTS table
10192: select XTR_BATCH_EVENTS_S.NEXTVAL
10193: into l_event_id from DUAL;
10194:
10195: Insert into XTR_BATCH_EVENTS(batch_event_id, batch_id, event_code, authorized,
10196: authorized_by, authorized_on, created_by, creation_date,
10197: last_updated_by, last_update_date, last_update_login)