Simple (?) PL/SQL help

From: Ingrid Voigt <giantpanda_at_gmx.net>
Date: Wed, 22 Jun 2016 22:08:30 +0200
Message-ID: <trinity-b7920199-a9e9-47ea-a60d-cfce1a203d75-1466626110415_at_3capp-gmx-bs16>

Hi,
 
is there a trick that will let one run a DML procedure inside a SELECT query?
 
The idea is to run a simple performance check from our nagios-based central monitoring
tool, and the plugin does not speak anything other than "select a single value from
somewhere".
 
I can schedule the DML within the database and let nagios pick up the result
but would also like the nagios to be able to run it on demand.
 
So I would have to set up a select that calls a function that calls a procedure. 
The procedure does Insert-Update-Delete, returns its runtime to the function
(or writes into a table or wherever I want), and the select gets it from there. 
The problem is, I don't get any return values.  
 
(Oracle version is 11.2.0.4 or 12.1.0.2)
 
create or replace function getruntime
return number
IS
  dmlruntime number(8);
begin
  dmltest(dmlruntime); 
  return dmlruntime;
end getruntime;
/
 
select getruntime from dual;
The value is always null.
 
Am I overlooking something simple here? Any help would be greatly appreciated.
 
 
Thanks
Ingrid
-- http://www.freelists.org/webpage/oracle-l Received on Wed Jun 22 2016 - 22:08:30 CEST

Original text of this message