How to pass string parameter without quotes?

Hi!

I have a very simple query in my report which has an ORDER BY at the end with one parameter:

ORDER BY  $P{form_item_order}

My problem is very simple. The ORDER BY is not wokring. The query looks like this:

product_data.`NAME` AS PRODUCT_NAME,
 
product_data.`ITEM_NR` AS ITEM_NR,
 
product_data.`EAN` AS EAN,

... if I give the parameter in, in the preview and if I execute it in my app, it's not working, because it's a string and it gets quotes. If I enter my query in MySQLWorkbench end execute it without any quote like this: ORDER BY PRODUCT_NAME it's working... I don't know why. But it looks like I need to pass a string without quotes. Is it possible?

VORiAND's picture
526
Joined: Nov 15 2018 - 7:26am
Last seen: 4 years 2 months ago

1 Answer:

Use

ORDER BY  $P!{form_item_order}

hozawa's picture
190407
Joined: Apr 24 2010 - 4:31pm
Last seen: 4 years 3 months ago
Feedback