Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Auto generating Sequences !!
Thank everyone who helped me.
I learned lot.
Instead of my horrible requirement I found a simple solution for my
requirement.
sql code are bellow
create or replace trigger t
before insert
on loan_payment
for each row
DECLARE
num number(2,0)
begin
select count(loan_number)+1 into num from loan where loan_number=:new.loan_number ;
select num into :payment_number from dual; end;
It will automatically fill it is howmanyth payment for a lon when new payment insert. (this is xactly what i wanted) (I can generate required format with some modification)
But now I want the prize for best horrible idea of year.!!!!!
I will seek your help next time i get another horrible idea.
than you all again! Received on Tue Apr 11 2006 - 10:55:42 CDT