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)
Need sql query to pull the project name and availabilty
Sniper
<p>Hi Team,</p><p> </p><p>I am new to this.</p><p> </p><p>We are using BIRT 2.6.2 version. We have merged the same with one of our application called as TMART.</p><p> </p><p>In TMART there is lot of applications that are getting monitored. So we need only the availability monitoring not any other parameter.</p><p> </p><p>When we ran this query we are getting the error as attached.</p><p> </p><p>Please find the attached script and error and let me know in case any modification is required.</p>
Find more posts tagged with
Comments
Hans_vd
<p>I'd say it's the $ and {} characters.</p><p>What database are you querying?</p>
Sniper
<p>Hi Hans,</p><p> </p><p>Thanks for your quick reply. We are using oracle database for the querying.</p>
Hans_vd
<p>Ok, what are all these constructs?</p><p> </p><p>${$USERID}</p><p>{'Week'}</p><p>${$DATETIME(${pmResults_Begin|'01/01/2000 00:00'})}</p><p>${$DATETIME(${pmResults_End|'01/01/2020 23:59'})}</p><p> </p><p>Parameters?</p><p>System variables?</p>
Sniper
<p>Hi Hans,</p><p> </p><p>These are parameters... But if you need i can provide the complete script... Actually this script is modified one...</p><p> </p><p>Let me know in case you need the complete script..</p>
Hans_vd
<p>Hi Sniper,</p><p> </p><p>Parameters need to be written as a ? in the query.</p><p> </p><p>So the query as it is in the file you uploaded will need to look like this:</p><div><pre class="_prettyXprint">SELECT projects.ProjectID_pk ProjectID, projects.ProjectName, tsd.MeasureName MName, SUM(tsd.ValCount) CountSeriesTime, SUM(tsd.ValSum)/SUM(tsd.ValCount) AvgValueFROM SCC_Projects projects INNER JOIN (SELECT DISTINCT pg.ProjectID_pk_fk FROM SCC_Projects_Groups pg INNER JOIN SCC_UserGroupRoles ugr ON pg.GroupID_pk_fk = ugr.GroupID_pk_fk WHERE ugr.UserID_pk_fk = ?) p2 ON (projects.ProjectID_pk = p2.ProjectID_pk_fk)INNER JOIN SV_V_Monitors_TimeSeriesData tsd ON projects.ProjectID_pk = tsd.ProjectID INNER JOIN SV_BusinessTransactions bt ON bt.MonitorID_pk_fk = tsd.MonitorID WHERE tsd.AggregationDescription = ?AND (projects.ProjectName = 'XYZ' OR tsd.MeasureName = 'Availability')AND tsd.SeriesTime >= ?AND tsd.SeriesTime <= ?GROUP BY projects.ProjectID_pk, projects.ProjectName, tsd.MeasureName, PerfTrt, PerfPageTimes, PerfCustom</pre></div><p>Now you need to add 4 dataset parameters.</p><p>The parameters are bound in order of appearance in the query.</p>
Sniper
<p>Hi Hans,</p><p> </p><p>Thanks for quick reply. If you need i will upload the complete script so that you can re-design the script as above one.. Basically there are no parameter will be monitoring... Under a certain project name there will be multiple monitor for which availability is required.</p>
Sniper
<p>Hi Hans,</p><p> </p><p>Any update?</p>
Hans_vd
<p>What exactly is the problem right now?</p><p>Do you have your query working?</p><p>Any other exceptions the report runs into?</p>
Sniper
<p>There is no query we have currently...</p><p> </p><p>Thanks for the update... I am still working on the same.</p><p> </p><p>It seems to be i need to create a seperate parameter for the places that you marked as ? and then i can map the above query with BIRT.</p><p> </p><p>In case any issues will let you know..</p>