Params in a query lambda

Hello, I have a query that I need to use a parameter:

Example:

select * from Table where fields like ‘%:id_player%’
Where Id player is the parameter.

In python code

params = ParamDict()
params['id_player'] = 'julio'

results = qlambda.execute(parameters = params)

When I execute resuts is
But If i execute the select I have data from the query […]
I execute: select * from Table where fields like ‘%julio%’ and i have data

¿Could you tell me how I write a python sample code to use parameters?

1 Like

Hey @jrios,

I believe that you are using parameters correctly. The main issue likely has to do with the underlying query.

The select * from Table where fields like '%:id_player%' query might not work as expected since the :id_player param value isn’t used in the executed query. Instead, the raw ':id_player' string is being used.

If we update our query to the following select * from Table where fields like concat('%', :id_player, '%'), the param value will be used, and should resolve our issue.

1 Like