Getting Data In

DB Connect SQL Procedures

Kyles
Observer

I've been using dbxquery connection=my_connection procedure=my_procedure to build reports and a few that my DBAs have built require time inputs, one I'm working on expects parameter '@StartDate',  Is there a way to pass that through to the stored proc?

Labels (1)
0 Karma

victor_menezes
Communicator

Hi @Kyles,

What version of DBConnect are you using?
The 3.* versions allow you to pass the field named params with values to be passed to the variables in the query/procedure:

dbxquery connection=<string> [fetchsize=<int>] [maxrows=<int>] [timeout=<int>] [shortnames=<bool>] query=<string> OR procedure=<string> [params=<string1,string2>]

Sample query:

dbxquery procedure="{call sakila.test_procedure(?, ?)}" connection="mysql" params="150,BOB"


 Please try that out if you are running DBConnect 3.x and let me know how it goes

0 Karma
Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  &#x1f680; Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...