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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...