All Apps and Add-ons

Calling stored procedures from the DB connect app

getmesomedata
Explorer

Hi,

Firstly I'm really enjoying the Splunk DB Connect app its really useful.

I've got a oracle database with a set of stored procedures in there and I was wondering if there was a way to call those stored procedures from within the app? I can copy the PL/SQL statements and get that to be called from within the app but I'd prefer to just call the stored procedure.

From a script I'd usually do something like:

var refcursor c_1;
execute stored_procedure_name(:c_1);
print :c_1;

I'd like to call the stored procedure from within the app and have the data returned in the refcursor stored within splunk.

0 Karma

davidpaper
Contributor

Hi,

There is a workaround to be able to query SPs. See https://answers.splunk.com/answering/386947/view.html for more info.

0 Karma

pmdba
Builder

As far as I can tell, only "select" statements can be executed from within Splunk. If you haven't figured this dilema out yet, try using a pl/sql function - which can return a value or a stream of data, and can be embedded in a "select" statement. Something like this:

select function(parameter) from dual;

I plan to test this myself soon. If it works I'll include sample code in this thread.

0 Karma

adityapavan18
Contributor

did this approach work??

0 Karma
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...