All Apps and Add-ons

Splunk DB Connect 2: Why is my SQL count(*) query not working with error "Unrecognized or ambiguous rising column name [mycol] is used."?

snehalk
Communicator

Hello All,

I am trying to pull the Oracle table into the Splunk. Below is my SQL query:

select count(*) from mytable {{where $rising_column$ > ?}}  

And am giving the Primary ID column name to rising_column field, but am getting the below error:

Unrecognized or ambiguous rising column name [mycol] is used. For Oracle database, qualified column name cannot be used, use "<qualified name> (<alias>)" instead.

Could you please help me on this?

0 Karma

vasanthmss
Motivator

Hi,

I think you are trying to pass the Splunk token into SQL select statement, If so the below will help you.

|dbxquery [|stats c | eval query="select count(*) from mytable where fieldname="+$rising_column$ | return query] connection="<connection>" | table *

You can create the query string in a sub search and pass it to the dbx query. Hope this will helps you..

Thanks,
V

V
0 Karma

joao_amorim
Communicator

No, he is comparing the $rising_column$ field with the last value referred by ?

Did you tested what you said?

0 Karma

joao_amorim
Communicator

Ok thanks for the replies.

But here we are talking about DB Con v2 and not DB Con v1.

Those links are from 2012 and related to DB Con v1, I'm migrating from DB Con v1 to v2.

In v1 I don't have any problems with the statement {{where $rising_column$ > ?}}, only when I'm trying to migrate the Data Inputs to v2.

Regards 🙂

0 Karma

joao_amorim
Communicator

Any news on this topic?

Regards

0 Karma

jkat54
SplunkTrust
SplunkTrust

I think $rising_column$ should be a non-ambiguous column name

Something like column.Name > ?

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Network to App: Observability Unlocked [May & June Series]

In today’s digital landscape, your environment is no longer confined to the data center. It spans complex ...

SPL2 Deep Dives, AppDynamics Integrations, SAML Made Simple and Much More on Splunk ...

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...