Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Auto generating Sequences !!

Re: Auto generating Sequences !!

From: chani <chanakam2000_at_gmail.com>
Date: 10 Apr 2006 22:33:16 -0700
Message-ID: <1144733596.407612.16700@g10g2000cwb.googlegroups.com>


>>>I think they have the docs in other languages. Do a search at
>>>otn.oracle.com
>>>Jim

Yes but unfortunately not in my language. I'm from SRI LANKA My language is "SINHALA"

I used following SQL (With Execute immediately code)

CREATE OR REPLACE TRIGGER ACCOUNT_T100
   BEFORE INSERT
   ON loan
   FOR EACH ROW
DECLARE
   seq_name VARCHAR2(10);
BEGIN

	seq_name := 'seq_';
	EXECUTE IMMEDIATE 'CREATE SEQUENCE' || seq_name ||'  start with 1

                                   increment by 1

                                   maxvalue 99999999

                                   minvalue 1

                                   nocache

                                   nocycle

                                   noorder' ;
END; Now I can create the trigger without error.!!!!

But When i try to insert new entry to loan table it says error in executing trigger.
I can't understand what the wrong with it?

(here I'm trying only to create one sequence. that is to know how to create sequence in a trigger.
But i will need dynamic name to sequence )

But now at least i can create trigger without error. I think i'm closer to solution.

please help me with your kind advices.
Thank!
I'm still learning execute immediately Received on Tue Apr 11 2006 - 00:33:16 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US