can not using the value of process variable in mysql query

1
0
-1

Hi,

I have human task(task1) to insert first name of employee to input field in form,then assign it to process variable named (newvar) of type text.in the second human task(task2) I can print the entered value of (newvar) in the form.in the third human task (task3) I made a connetor to mysql database to get number of leaves to employee according to entered name(newvar) and I used the following query:

SELECT num_of_admin_leave FROM db_full_company.employee where first_name='$"{newvar}"' ;

but i get NULL.
the query working when I used direct name of employee , but it can not see the value of (newvar).

I tried to use business variable instead of process variable but it can not be seen in query when press ctrl+space

please ,what should I do?

1 answer

1
-1
-1

Hi Rowa

the query should be (remove " )

SELECT num_of_admin_leave FROM db_full_company.employee where first_name='${newvar}' ;

Comments

Submitted by Rowa on Tue, 03/08/2022 - 19:03

Hi Laurent

I tried this query

SELECT num_of_admin_leave FROM db_full_company.employee where first_name='${newvar}' ;

But I got the following error when I tested it:

Unsupported expression type for testing: -Input parameter 'script' uses an unreachable Expression

Notifications