Hi,
I am trying to execute below sql in DB connect execute mode with collection_timestamp as my rising column but keep getting below error. This query works fine on the DB and returns some values.
SQL query
SELECT d.target_name,
collection_timestamp,
metric_label,
column_label,
key_value,
value
FROM sysman.mgmt$metric_details d,
sysman.mgmt$target t
WHERE t.timezone_region IN ('America/Chicago')
AND t.target_name = d.target_name
AND metric_name in ('tbspAllocation','memory_usage')
AND collection_timestamp >=?
ORDER BY 2,1,3,4,5
Error
Invalid Query
External search command 'dbxquery' returned error code 1. Script output = "RuntimeError: Failed to run query: "SELECT * FROM (SELECT d.target_name, collection_timestamp, metric_label, column_label, key_value, value FROM sysman.mgmt$metric_details d, sysman.mgmt$target t WHERE t.timezone_region IN ('America/Chicago') AND t.target_name = d.target_name AND metric_name in ('tbspAllocation','memory_usage') AND collection_timestamp >=? ORDER BY 2,1,3,4,5) t", params: "None", caused by: Exception(' java.sql.SQLException: Missing IN or OUT parameter at index:: 1.',). "
try to add ORDER BY collection_timestamp ASC
for some unknown reason, a standard structure is required for the where clause for rising column