I'm trying to make a conditional insert statement in the process designer using "SQL Statement Info Editor". And I'm getting "Invalid SQL statement".
Is there any alternative to implement this or is it just a syntax error to what I'm doing?
This is just an example of the issue, if I remove the if statement it will work.
To the best of my knowledge, the IF statement can be used in Stored Procedures Language and then called by JDBC but not directly as above. Here is one workaround but vendor specific : http://www.itjungle.com/fhg/fhg071608-story02.html
If the conditional SQL is critical to your logic, vs. splitting the SQL into 2 activities/calls,
Then you may want to look at using Java inside an ExecuteScript activity.
You usually have more flexibility using a prepareStatement, but you need to be sure to trap and handle and errors.