Aw: RE: Simple (?) PL/SQL help
Date: Thu, 23 Jun 2016 20:25:04 +0200
Message-ID: <trinity-1000c2ef-2de1-4a28-8c58-919ae176aab3-1466706304389_at_3capp-gmx-bs70>
Von: "Dimensional DBA" <dimensional.dba_at_comcast.net>
An: giantpanda_at_gmx.net, oracle-l_at_freelists.org
Betreff: RE: Simple (?) PL/SQL help
Nagios has the capability of executing procs in the database and returning results to alarm based on.
The Nagios websites have a variety of examples you can download for free.
Matthew Parker
Chief Technologist
Dimensional DBA
425-891-7934 (cell)
D&B 047931344
CAGE 7J5S7
Dimensional.dba_at_comcast.net
From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Ingrid Voigt
Sent: Wednesday, June 22, 2016 1:09 PM
To: oracle-l_at_freelists.org
Subject: Simple (?) PL/SQL help
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