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)
Inserting more than one value in a parameter
ELY_Che
Hello ,
I'm trying to insert more than one value in a parameter of type text ,
Using Filter i only can put a comma separation on the whole Data set.
My problem is that my data set has more than one ?(place holder)
and i need to insert multi-values on each place holder .
Please to check a Data set as an example :
___________________________________
select emp_name
from employees
where emp_id in (?,?,?)
and emp_status in (?,?,?)
and emp_lst_name not in (?,?,?)
Find more posts tagged with
Comments
Hemant123
<blockquote class='ipsBlockquote' data-author="'ELY_Che'" data-cid="94751" data-time="1327935386" data-date="30 January 2012 - 07:56 AM"><p>
Hello ,<br />
<br />
I'm trying to insert more than one value in a parameter of type text ,<br />
Using Filter i only can put a comma separation on the whole Data set.<br />
<br />
My problem is that my data set has more than one ?(place holder) <br />
and i need to insert multi-values on each place holder .<br />
<br />
Please to check a Data set as an example :<br />
___________________________________<br />
select emp_name <br />
from employees <br />
where emp_id in (?,?,?)<br />
and emp_status in (?,?,?) <br />
and emp_lst_name not in (?,?,?)<br /></p></blockquote>
Hemant123
Hi Ely
Can you possibly have example and I can look into the same.
Tubal
What kind of dataset are you using? A query?
ELY_Che
Hello ,
Yes i'm using a query ,
the parameter type is a textbox ,
inside the same query i need to implement my parameter more than one time.
And on execution level i need to have the possibility to insert multiple values coma separated .
i will try to attach a small example if my point of view is not 100% clear.
Thanks for the Help.
Tubal
<blockquote class='ipsBlockquote' data-author="'ELY_Che'" data-cid="94779" data-time="1327993185" data-date="30 January 2012 - 11:59 PM"><p>
Hello ,<br />
<br />
Yes i'm using a query ,<br />
the parameter type is a textbox ,<br />
inside the same query i need to implement my parameter more than one time.<br />
And on execution level i need to have the possibility to insert multiple values coma separated .<br />
<br />
i will try to attach a small example if my point of view is not 100% clear.<br />
<br />
Thanks for the Help.<br /></p></blockquote>
<br />
There are a few ways you can do it. The easiest way would probably be to modify your parameter after you've passed it in the beforeOpen script event of your dataset (the query), and then replace the text in your query with your new parameter.<br />
<br />
Here's an example script I use in one of my reports. This is in the beforeOpen event of the query:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>var parmcount = params["ven_cd"].value.length;
var vendors = "";
for ( i=0; i < parmcount; i++ ){
if( i == 0){
vendors = vendors + "'" + params["ven_cd"].value[i] + "'";
} else {
vendors = vendors + "," + "'" + params["ven_cd"].value[i] + "'";
}
}
if ( parmcount > 0){
this.queryText = this.queryText.replace("/**vendors**/", " s.vendor_cd IN (" + vendors + ") and ");
} else {vendors = 'All Vendors'}</pre>
<br />
Basically what I'm doing is taking my input from a multiselect report parameter, parsing it into a comma delimited string, and then replacing any instance of /**vendors**/ in my query with an in statement.<br />
<br />
If your report parameter is just a text string, you can skip the parsing, and use the replace part of the script.
ELY_Che
Hello Tubal,
Thanks for the Help.
I used something similar .
check it in case you need it for a future use:
var myParam = params["P_INVCODE"].value;
this.queryText =this.queryText.replace("/**p_invcode**/","("+ myParam
+") ");
Packages.java.lang.System.out.println ("\n Resultttttttttt: "
+this.queryText);