Replacing wildcards in parameters

Options
PikeyBoy
edited February 11, 2022 in Analytics #1
Hi All, please forgive me if this is asking the obvious but I can not work it out.

I have a report that is linked to my SQL database the query that I run has parameters in it, all of my users are used to using '*' as a wild card but when doing a like in SQL you need the '%'.

Is there a nice way in BIRT to allow the user to input into the parameter a '*' and then replace in the backgound with a '%' before running the query?

Hope that makes sense

Thanks in advance for any help from a newbie.

Comments

  • Hans_vd
    edited December 31, 1969 #2
    Options
    Hi PikeyBoy,<br />
    <br />
    You can write this script in the parameter validate script:<br />
    <pre class='_prettyXprint _lang-auto _linenums:0'>params["wildcardParam"].value = params["wildcardParam"].replace("*","%");
    true;</pre>
    <br />
    Hope this helps<br />
    Hans
    Warning No formatter is installed for the format ipb
  • PikeyBoy
    edited December 31, 1969 #3
    Options
    Hans,

    Great thanks for that works a treat, its just knowing where to look.

    Thanks for the speedy reply.

    Ian
  • Hi Hans_vd,

    I want to do some customization in advance search xcelerator contains(wild card values). please suggest me, I need to add a wild card parameter in list

    Thanks in advance