Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tablename as parameter #118

Open
Tedigom opened this issue Apr 13, 2022 · 3 comments
Open

tablename as parameter #118

Tedigom opened this issue Apr 13, 2022 · 3 comments

Comments

@Tedigom
Copy link

Tedigom commented Apr 13, 2022

Hi, I'm facing an issue using parameters

I want to use parameter after FROM clause in my query ( using tablename as a parameter),
and I got an Error "invalid table name".

ERROR - query-exporter - query "kafka_unpublished[params0]" on database "oracle" failed: (cx_Oracle.DatabaseError) ORA-00903: invalid table name

Is there any method allowed me to use parameter after FROM clause?

Installation details
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0
query-exporter 2.8.0 ( docker )

my config is

queries:
  kafka_unpublished:
    databases: [oracle]
    metrics:
      - kafka_unpublished
    sql: |
            SELECT COUNT(*) AS kafka_unpublished, 'Topic01' AS topictest FROM :param1 GROUP BY del_yn
    parameters:
      - param1: TABLE01
@albertodonato
Copy link
Owner

It's currently not possible to specify the table name as parameter. Parameters can only be used where literal values are allowed

@chrisulbrich
Copy link

This would be a useful feature for me, too.
I've got many tables on which I want to execute the same query.

@hypePG
Copy link

hypePG commented May 4, 2023

+1

any chance we could implement that in a coming release? i could offer my help aswell :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants