Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Preprocessor query throwing error

sbiswal
New Contributor II
New Contributor II

Hello team,

Working on a preprocess query where we're storing a flag value in a customproperty, based on employee type/ If emptype is Industrial, then cp40 should be 2, else it should be 1.

For this I've used the queries:

"UPDATE NEWUSERDATA NU LEFT JOIN CURRENTUSERS SET NEWUSERDATA.CUSTOMPROPERTY40 = case when NEWUSERDATA.EMPLOYEETYPE LIKE '%Industrial%' then '2' else '1' end where CURRENTUSERS.USERNAME=NEWUSERDATA.USERNAME"

"UPDATE NEWUSERDATA NU LEFT JOIN CURRENTUSERS SET NEWUSERDATA.CUSTOMPROPERTY40 = case when NEWUSERDATA.EMPLOYEETYPE LIKE '%Industrial%' then '2' else '1' end"

and 

"UPDATE NEWUSERDATA NU LEFT JOIN CURRENTUSERS SET NEWUSERDATA.CUSTOMPROPERTY40 = case when NEWUSERDATA.EMPLOYEETYPE LIKE '%Industrial%' then 2 else 1 end"

In all, I am getting error:
You have an error in your SQL syntax; check
the manual that corresponds to your MySQL server
version for the right syntax to use near 'SET
TEMPNEWUSERS_242611.CUSTOMPROPERTY40 = case when
TEMPNEWUSERS_242611.EMPLOYE' at line 1

Our version is 23.3. Does anyone have any alternate way of writing this or any input on what the issue is?

Thanks,

Seemran Biswal

2 REPLIES 2

ParitaSavla
Saviynt Employee
Saviynt Employee

Can you try with this query

UPDATE NEWUSERDATA SET NEWUSERDATA.CUSTOMPROPERTY40 = case when NEWUSERDATA.EMPLOYEETYPE LIKE '%Industrial%' then '2' else '1' end

dgandhi
All-Star
All-Star

Hi,

Can you please try below?

UPDATE NEWUSERDATA u SET CUSTOMPROPERTY40 = (case when u.EMPLOYEETYPE LIKE '%Industrial%' then '2' else '1' end)

Thanks

Devang

Thanks,
Devang Gandhi
If this reply answered your question, please Accept As Solution and give Kudos to help others who may have a similar problem.