Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Prepared Statements
ChristopheXx
<p>Hi, pardon my ignorance if this is actually simple or/and basic but I am really curious.</p>
<p> </p>
<p>I stumbled across an old report that my mentor (who already left) wrote. It uses a statement "date(wo.actfinish) between ? and ?" in the script. A little googling about the questions marks led to prepared statements for SQL.</p>
<p> </p>
<p>However, I still don't really understand how to implement it or how it works. I also tried making a simple report. Testing the SQL in Toad gives me a little prompt to enter an input but it fails to run in BIRT. Can anyone teach me how to implement this? </p>
<p> </p>
<p>Thanks.</p>
Find more posts tagged with
Comments
SoccerMZG
<p>Hello Chris,</p>
<p> </p>
<p>When working a JDBC connection this statement "<span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">date(wo.actfinish) between ? </span><span style="background-color:#FFFF00;color:#FF0000;font-family:'Source Sans Pro', sans-serif;">and</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;"> ?" </span>in the dataset query will automatically add dataset parameters. If these parameters have null default values then the preview will not show any data. In my experience, you would link these dataset parameters to report parameters. This replaces (a parameter prompt similar to what you are talking about with toad pops up when you run the report) the "?" with a value. <br><br>
The difference with your rptdesign is that you are using scripted datasets, since you are running this through Maximo. Therefore you must create a long string in your script and pass it to Maximo as the variable sqlText. In this case you should replace the "?" with the report parameter like this: "wo.status = '" + params["AddStatus"] + "' " . I took this from your rptdesign. If you are running this report through Maximo, you must make sure that the inputs you select are being passed to the rptparameters.</p>
<p> </p>
<p>Are you using opensource BIRT or the commercial product? I could send you examples, I just need to know what version you are running.</p>
<p> </p>
<p>Mark</p>
ChristopheXx
<p>Hello, thanks for the reply. </p>
<p> </p>
<p>I am not sure but I believe I am using the opensource.</p>