Commit 69119f28 authored by vvengurlekar's avatar vvengurlekar

System_Entries.sql - update line_no in pay_ibca_det, trigger for updating existing line no


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@192298 ce508802-f39f-4f6c-b175-0d175dae99d5
parent fc4173ba
......@@ -654,4 +654,35 @@ update system_events set service_code='poic_default_ejb', comp_type ='JB', comp_
UPDATE SYSTEM_EVENTS SET service_code='prv_default_ejb', comp_type ='JB', comp_name ='ibase.webitm.ejb.fin.PaymentExpenseEJB' where obj_name = 'payment_exp' and event_code = 'pre_validate';
----------------------------SYSTEM EVENTS ENTRY ADDED BY VARSHA V ON 02-10-18 [End]---------------------------
\ No newline at end of file
----------------------------SYSTEM EVENTS ENTRY ADDED BY VARSHA V ON 02-10-18 [End]---------------------------
----------------------------SYSTEM EVENTS ENTRY ADDED BY VARSHA V ON 24-10-18 [START]---------------------------
alter table pay_ibca_det add line_no number(3);
update pay_ibca_det outer set line_no = (
select rnum from (
select tran_id,rowid, row_number() over (partition by
tran_id order by tran_id, ref_no, ref_ser) rnum
from pay_ibca_det) inner
where inner.rowid = outer.rowid) ;
alter table pay_ibca_det modify line_no not null;
alter table pay_ibca_det drop constraint primary;
alter table pay_ibca_det add constraint pay_ibca_det_x primary key (tran_id,line_no);
commit;
create or replace trigger trig_pay_ibcadet before
insert on pay_ibca_det for each row
declare max_line_no number(4);
begin
max_line_no := 0;
if :new.line_no is null then
select max(line_no) into max_line_no from pay_ibca_det where tran_id = :new.tran_id;
:new.line_no := nvl(max_line_no , 0) + 1;
end if;
END;
/
----------------------------SYSTEM EVENTS ENTRY ADDED BY VARSHA V ON 24-10-18 [END]---------------------------
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment