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)
How to pass report parameter in sql query in scripted dataset
delta123
I want to design a report through scripted datasource. and am taking a Date type report parameter. now want to pass this report parameter into my sql query. So i passing it in my dataset open script as
myrows = new PrescriptionRow();
myrows.loadPrescription(params["RegDate"]);
i am having a PrescriptionRow java class in which loadPrescription(Date dt) is a method that retrieving data from database using sql query like "select ........from .......where ......_date=dt;
but i am not able to get any reecord through this approach and even there is no any error msg.
plz suggest me any idea.
Find more posts tagged with
Comments
mwilliams
In your open script, if you put a date value, as you'd put it in the parameter box, in place of params["RegDate"], does the query return data then?
delta123
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="82041" data-time="1314642150" data-date="29 August 2011 - 11:22 AM"><p>
In your open script, if you put a date value, as you'd put it in the parameter box, in place of params["RegDate"], does the query return data then?<br /></p></blockquote>
delta123
my problem has been resolved. I have to put date variable in my query inside single quotes as
select ........from .......where ......_date='dt';
mwilliams
Great to hear! That's the issue I was suspecting it'd be.
Let us know whenever you have questions!