cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SQL: capture column value not working for columns using an alias

joerg_fenin
Newcomer

Hi,

first of all: We are (unfortunately) still running DT 6.1 and I have browsed thru the docs here but haven't found anything appropriate.

I have created a DB monitor and am trying to capture the value of a DB column by using an alias. The original column type is a string and I have mapped the string value to a number by using the TO_NUMBER function of Oracle like this:

select TO_NUMBER(DECODE(system_state,'NOT_OPEN','0','AVAILABLE','1')) as gate_open from ...

This works fine when executing the query directly in the database, and the DB monitor returns "success" but always returns 0 for the column data and also displays a row count of 0 (thus showing that it hasn't received anything at all).

Querying (numeric) fields without aliases or querying "count(*)" works fine so in general it seems to work.

Did anybody encounter this problem as well and may indicate me to some solution?

Thank you.

2 REPLIES 2

andreas_grabner
Dynatrace Guru
Dynatrace Guru

Hi Joerg. Which plugin are you using? Maybe we can talk with the plugin creator to see whether there is a fix to this issue. Or - in case you are using one of the Community Plugins you could also check out the source code as it is on github

joerg_fenin
Newcomer

Hi Andreas,

thank you for your help. It was "only" a semicolon at the end of the SQL-Statement. While this is common in most of the SQL tools, it must not be there in the DB Query plugin.