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

Home -> Community -> Usenet -> c.d.o.tools -> DDL statements in a trigger?

DDL statements in a trigger?

From: <jonterje_at_link.no>
Date: Mon, 23 Oct 2000 11:32:55 GMT
Message-ID: <8t17l7$oka$1@nnrp1.deja.com>

Hello all,

My company uses a third party application development tool that only allows us to do simple selects, inserts, updates and deletes against an Oracle 8.1.5 database. (I know this doesn't sound very impressive, but there are other very good reasons for using this tool.) From this tool we need to create sequences "on-the-fly" for the applications we are developing. I have tried to come up with a solution to this, given the limitations we develop under. I had an idea that an insert into a table could fire a trigger that creates the sequence we need, but Oracle will not let me put DDL statements inside the trigger:

CREATE TABLE Counters(
  sequenceName varchar2(30) not null);

create or replace trigger Counters_trig
 before insert on Counters
 for each row
 begin
   create sequence :new.sequenceName;
 end;

insert into counters values ('test_cnt');

select test_cnt.nextval from dual;

Obviously, this does not work. Does anyone know a workaround? Or is there an entierly different solution?

--
Jon-Terje Lilleby


Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Mon Oct 23 2000 - 06:32:55 CDT

Original text of this message

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