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)
Best practice for creating temporary tables before execution
bolderiz
<p>Hi,</p>
<p> </p>
<p>I use Birt since a while (10 years...), mainly for personal tools. Big thanks to Actuate for that wonderful piece of software.</p>
<p> </p>
<p>I'd like to know if it's possible to create a database table according to submitted birt parameter. I'd like to improve performances and readability of reports.</p>
<p> </p>
<p>For instance with a parameter on year, a temporary table could be :</p>
<p> </p>
<p>'create table year2014 as select customer, count(distinct product) nb_products from purchases where year =? group by customer'</p>
<p> </p>
<p>and datasets may use it :</p>
<p>dataset 1 : 'select * from year2014 where nb_products =5'</p>
<p> </p>
<p>Any advice ?</p>
<p> </p>
<p>Thank you in advance,</p>
<p> </p>
<p>Ali</p>
Find more posts tagged with
Comments
micajblock
<p>Why do you want to create a temporary table? In BIRT a data set will only be executed once no matter how many times it is used? Can you detail the use case?</p>
bolderiz
<p>I use several datasets (oracle queries) in my birt report. </p>
<p>Each dataset corresponds to a different Oracle query (with analytic functions mainly sum over and lead/lags ) applied on a same <strong>sub-select</strong> that depends on the submittted parameters. </p>
<p> </p>
<p>My aim is to pre-compute the sub-select in a temp table, to gain in perfo and readability <strike>lisibility</strike>. </p>
micajblock
<p>My question still remains. Why not one data set and put the analytic functions in the report? That being said although I have not tried it, but should work, why not create a stored procedure with the create statement and return 1 dummy row. The in BIRT use the SP as a data set. As long as there is a table (which you can set the display to none) first that uses this new data set and place it at the beginning of the report, it will be executed first.</p>
bolderiz
<p>Thanks for the idea, i'll try. </p>
<p> </p>
<p> </p>
<blockquote class="ipsBlockquote" data-author="mblock" data-cid="146710" data-time="1485891872">
<div>
<p>My question still remains. Why not one data set and put the analytic functions in the report? </p>
</div>
</blockquote>
<p> </p>
<p>In my case it's a specific usage and I don't have enough time to figure out how to implement in birt what I can easily do via sql.</p>