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!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...