develooper Front page | perl.dbi.users | Postings from January 2012

More of an oracle question than dbi...

Thread Next
From:
Bruce Johnson
Date:
January 9, 2012 08:30
Subject:
More of an oracle question than dbi...
Message ID:
9ECBA4D4-FEFC-49C2-9A37-C47C7CB27DFD@pharmacy.arizona.edu
...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



Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About