Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Auto generating Sequences !!
Hi,
Thank everyone who helped on my previous post. But I have to seek some more help from you.
I want to create sequences for each entity entered to loantable
My requirement is to have
payment_001,payment_002,... for loan_0001 payment_001,payment_002,... for loan_0002 payment_001,payment_002,... for loan_0003 .. & so on
(I want to generate payment_number belong to a loan from sequence)
for this I should have seperate sequence for each loan entry such as
seq_loan001, seq_loan002,....
I tried following sql trigger, But It says error
CREATE OR REPLACE TRIGGER LOAN_PAY_TR
BEFORE INSERT ON loan FOR EACH ROW BEGIN IF inserting THEN CREATE SEQUENCE LP /* Here I want to generate sequence name dynamically, But have no idea how to do it, can i use char functioons here (need help for it also) */ start with 1 increment by 1 maxvalue 9999 minvalue 1 nocache nocycle noorder END IF;
I explained my problem in large text. Because I want you to understand
my question.
But I don't know how to explain some of them in english properly. I
hope you will understand.
Can you Please help me. (If this is not possible let me know it!) Received on Mon Apr 10 2006 - 12:18:21 CDT