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)
Modify Table
jfreak53
Is there a way to have BIRT modify a table before running other queries?
Like I need it to modify (or create) a view at the time of running before any other queries run.
Find more posts tagged with
Comments
mwilliams
Can you explain in a little more detail about what you're wanting to do?
jfreak53
Ok, I'm still in the middle of transfering over this old system to a web system. So their old DB used Views a lot, I mean all the time. So this one report that I have to make uses about 4 different views, one of which is a union of about 3 different quieres. Problem being that in this one view there is a filter by X data. This filter has to be changed before the other quieres call this view, so the only way to do that in MySQL is dump the view and re-create with the correct filters. So before I run all the quieres of the report I need to dump the view and re-create it.
The only option I can think of is have a PHP page do the parameters before the report comes up, then just do all that there. But I would like to not do this if possible. That's why I was thinking maybe BIRT has a way of running insert and dump commands in MySQL. If so, then I'm safe.
mwilliams
Still not certain if I'm understanding correctly, but in BIRT, with a JDBC dataSet, you can insert dataSet parameters in your SQL. You can then use the dataSet parameter binding feature in BIRT to change the values of these parameters, so if you can insert dataSet parameters in a way in which you can modify your query to do what you need, you could do it this way. Let me know if I'm way off base with what you're wanting to do.
jfreak53
Yeah I think I'm still having trouble explaining it ha ha ha, thanks for the try. Ok let me try to set this up once more here, my mind has trouble explaining this one. Let me try an example a little easier to explain.
Let's say I have a VIEW in my DB. And the query in Birt that I use calls from this view, not from a table. So I can't filter on the query in Birt, let's just say I can't since the view has to filter before it gets to the query. So what I have to do is DROP the view, then CREATE VIEW once more from inside Birt before I call my final query. This create view has to have the params from Birt. Once the view is created then I using another DS call the query that calls this new view with the new params in the view.
I hope I explained it right there, it's still kind of iffy in my own head ha ha ha
Thanks for all the help.
mwilliams
DataSets are sequentially called in BIRT depending on the order in which they appear in the report, so if you need to create multiple dataSets, you could technically grab data from one and then pass that data to the next before it is run.
jfreak53
Yes, but will BIRT allow me to do inserts and other such things and if so how? I have tried it in a DS and it didn't work.
jfreak53
Any thoughts?
mwilliams
Sorry, I've consulted a colleague to see if he has any ideas. I'll let you know!
jfreak53
Not a problem, thanks for the help. Just wanted to make sure my thread didn't get burried ha ha ha.