More of an oracle question than dbi...

Bruce Johnson <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.general
Message-ID <[email protected]>
...but I'm trying to do this via a script.

The code:

create or replace trigger resource_key before insert on resources
for each row 
begin
select resource_id_seq.nextval into :new.resource_id from dual;
end;

Works in sqlplus, but does not when executed via dbi or via jdbc.

What I end up with instead is the code in the trigger:

create or replace trigger resource_key before insert on resources
for each row 
begin
select resource_id_seq.nextval into :new.resource_id from dual

And an error about an invalid sql command for the 'end;' bit.

How do I make this work within dbi?


-- 
Bruce Johnson
University of Arizona
College of Pharmacy
Information Technology Group

Institutions do not have opinions, merely customs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.