Data Provider Preview breaks when using a Query with a Comment at the end
search cancel

Data Provider Preview breaks when using a Query with a Comment at the end

book

Article ID: 448452

calendar_today

Updated On:

Products

Clarity PPM On Premise Clarity PPM SaaS

Issue/Introduction

A Data provider containing a query with single line comment at the end of the query will cause the preview of the data provider to break. 

Steps to Reproduce :- 

1. Navigate to MUX -> Reporting -> Data Provider.
2. Create a new Data Provider and select the "Include Query" Check box.
3. In the Query tab, create a new query and use the following query.
SELECT "Test1" as T1,
"Test2" as T2,
"Test3" as T3
FROM DUAL --Query 1

4. Check the Preview tab and add any column.

Expected Result :- Preview will show up.
Actual Result :- Preview error's out. 

The following errors are observed in the UI.

Oracle Error:

Unable to process the request: ORA-00907: missing right parenthesis

Postgresql Error:

Unable to process the request: ERROR: syntax error at end of input Position: XXX

Environment

Clarity PPM 16.4.x

Cause

This is caused when we have a single line comment at the end of the query. When application appends it's own wrapper to the defined Query the single line comment causes parts of the final query to be commented out as well. 

 

Resolution

  1. Remove the comments in the query which are present at the end of the query.
  2. If the comment is required use the multi-line comment format. Ex :- /* Query1 */