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

Home -> Community -> Usenet -> c.d.o.misc -> Re: DML from a function

Re: DML from a function

From: DA Morgan <damorgan_at_x.washington.edu>
Date: Sun, 27 Mar 2005 10:44:19 -0800
Message-ID: <1111948844.640991@yasure>


Randy Harris wrote:
> I've written a function to handle the Interval for a DBMS_JOB (with help
> from folks here). I wanted to have it write to a log each time it ran, so I
> added a simple INSERT into it. I promptly got an error that DML statement
> are not permitted in a "query" (I guess it means a function?). I figured,
> no problem, I'll simply create a Procedure that will write to the log and
> call the procedure from the function. That caused the same error. Is there
> a "simple" way around this?

It would be helpful to know what error message you received, too see the DML, etc. but given what little you have provided ... look at using PRAGMA AUTONOMOUS TRANSACTION. www.psoug.org
click on Morgan's Library
click on Autonomous Transaction
for an example

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace 'x' with 'u' to respond)
Received on Sun Mar 27 2005 - 12:44:19 CST

Original text of this message

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