Splunk Search

How to setup multiple SQL statements in a single DB Connection input

tpirozzi
Explorer

Hi Everyone,

I am creating DB inputs in the Splunk DB Connector 3.0.2. I would like to run 2 sql statements or possibly more in some instances . When I use a semi column to separate in the Choose and Preview with the editor version sql I get

Invalid Query
java.sql.SQLSyntaxErrorException: ORA-00922: missing or invalid option

Here is an example:

alter session set current_schema=test;
select
column1
from
test_table

Any help appreciated.

Tags (1)
0 Karma

tpirozzi
Explorer

Thanks. That is what I have done so maybe this is a bad example. I guess the ultimate question is does it support multiple sql statements or do I have to combine into one? I have looked for the answer but did not find anything in the docs.

0 Karma

gjanders
SplunkTrust
SplunkTrust

I do not believe the underlying JDBC statement will allow this but happy to be proven wrong here !

0 Karma

gjanders
SplunkTrust
SplunkTrust

In your example why not just use:
select
column1
from
test.test_table

Some databases might allow multiple queries via JDBC statements (where JDBC statements are what the DB input is really running) but by default most will not.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...