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)
String parameter
flosmi
<p>Hi,</p><p> </p><p>i want to insert a string parameter into my statement:</p><p> </p><p>select id from test</p><p>where id in (?)</p><p> </p><p>the parameter are e.g.: 'A12','A14'</p><p> </p><p>but i think birt creates something like:</p><p>...</p><p>where id in(''A12','A14'')</p><p> </p><p>how can i prevent the outer ' ' when i use string parameter?</p><p> </p><p>thanks</p>
Find more posts tagged with
Comments
micajblock
<p>First of all your SQL is not valid SQL. You cannot parameterize an IN clause like that. If you are using a multi-select parameter, you can use this technique:</p><p> </p><p><a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/devshare/_/designing-birt-reports/771-using-a-multivalue-parameter-in-a-in-clause'>http://developer.actuate.com/community/devshare/_/designing-birt-reports/771-using-a-multivalue-parameter-in-a-in-clause</a></p>
;
flosmi
<p>hi,</p><p> </p><p>no it is not a multiselect parameter.</p><p> </p><p>i use two statements and a nested table to handover the values of a column. -> (<a data-ipb='nomediaparse' href='
http://eclipse.org/birt/phoenix/examples/reports/birt2.1/subreport/index.php'>http://eclipse.org/birt/phoenix/examples/reports/birt2.1/subreport/index.php</a>)
</p><p> </p><p>and in the column the values look like e.g. 'A12', 'A13' and i think when i handover this string birt creates something like this ''A12','A13'' but i dont need the outer ' in my statement - how can i prevent them?</p>
micajblock
<p>Why do you think BIRT is adding the quotes? Again 'where id in (?)' is not valid SQL. ? is used for single value parameters (+,>...) and cannot be used to parameterize an IN clause. </p>