Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Case Statement Value as a BIRT Parameter value.
rmendonsa
I have a view that includes a case statement which is as follows...
CASE
WHEN csctbl_eswbs.csc_pending = 1
THEN upper('Warning')
ELSE '--'
END AS ErrorType
In BIRT report designer when I try to create a parameter based on the case value (ErrorType value), the report does not display any data.
BIRT SQL is as follows...
sqlText = "select * from testone"
+ " where " + params["where"]
+ " and testone.siteid = " + "'" + params["siteid"] + "'"
+ " and testone.ErrorType = " + "'" + params["ErrorType"] + "'" (when I include this statement the report displays no results.)
When I take the same BIRT sql and run it in Oracle SQL Developer, it runs fine and displays data.
BIRT SQL in Oracle:
select * from testone where 1=1 and testone.siteid = 'TTA1000' and testone.ErrorType = 'WARNING'
Any reason why the same sql works in Oracle but not in BIRT?
Thanks.
Find more posts tagged with
Comments
mwilliams
If you output your query text to your design, what does it show you? The same as in Oracle? Let me know.
rmendonsa
Below is the text from the log file after the report is run. The BIRT dataset nor the report displays any data....whereas, the same sql in oracle returns data.<br />
<br />
Mon Aug 29 11:49:44 CDT 2011 INFO DataSet [dataSet] open called.<br />
Mon Aug 29 11:49:44 CDT 2011 INFO DataSource [maximoDataSource] getConnection called<br />
Mon Aug 29 11:49:44 CDT 2011 INFO DataSource MXReportScriptContext = com.ibm.tivoli.maximo.report.script.MXReportScriptContext@13f9590<br />
Mon Aug 29 11:49:44 CDT 2011 DEBUG *Requested Data Source: maximoDataSource<br />
Mon Aug 29 11:49:44 CDT 2011 INFO Using mxreportdatasources.properties file to load Data Sources<br />
Mon Aug 29 11:49:44 CDT 2011 INFO Adding Data Source: maximoDataSource<br />
Mon Aug 29 11:49:44 CDT 2011 INFO Adding Data Source: maximoDataSource<br />
Mon Aug 29 11:49:44 CDT 2011 INFO Adding Data Source: maximoDataSource<br />
Mon Aug 29 11:49:44 CDT 2011 INFO Adding Data Source: maximoDataSource<br />
Mon Aug 29 11:49:44 CDT 2011 INFO Adding Data Source: maximoDataSource<br />
Mon Aug 29 11:49:44 CDT 2011 DEBUG *Checking for Data Source: maximoDataSource<br />
Mon Aug 29 11:49:44 CDT 2011 DEBUG loaded Data Source: maximoDataSource<br />
Mon Aug 29 11:49:44 CDT 2011 DEBUG Designtime DataSource [maximoDataSource] = maximoDataSource<br />
Mon Aug 29 11:49:44 CDT 2011 DEBUG Designtime DataSource [maximoDataSource] [driver] = oracle.jdbc.driver.OracleDriver<br />
Mon Aug 29 11:49:44 CDT 2011 DEBUG Designtime DataSource [maximoDataSource] [url] = jdbc:oracle:thin:
@biworadev002
.gdbiw.com:1521:csamaxdv<br />
Mon Aug 29 11:49:44 CDT 2011 DEBUG Designtime DataSource [maximoDataSource] [username] = maximo<br />
Mon Aug 29 11:49:44 CDT 2011 DEBUG Designtime DataSource [maximoDataSource] [schemaowner] = maximo<br />
Mon Aug 29 11:49:45 CDT 2011 INFO Designtime DataSource [maximoDataSource] connection = oracle.jdbc.driver.T4CConnection@1d3c59a<br />
Mon Aug 29 11:49:45 CDT 2011 INFO DataSet [dataSet]:<span style='color: #FF0000'> <span style='color: #98FB98'>select * from testone where 1=1 and testone.siteid = 'TTA1000' and testone.ErrorType = 'WARNING'</span></span>Mon Aug 29 11:49:45 CDT 2011 INFO DataSet [dataSet] close called.<br />
Mon Aug 29 11:49:46 CDT 2011 INFO DataSource [maximoDataSource] connection = oracle.jdbc.driver.T4CConnection@1d3c59a - CLOSED<br />
<br />
Thanks.[/url]
mwilliams
I meant to save your query text to a variable and output it to a dynamic textbox in your design after an element bound to your dataSet so that you can see how the query turns out in BIRT.