cancel
Showing results for 
Search instead for 
Did you mean: 

LAST_INSERT_ID() sql statement activiti

zilarion
Champ in-the-making
Champ in-the-making
Using LAST_INSERT_ID() does not result in the correct value. Is this function not supported in activiti?

I am using the following queries:

Service task with an end listener with the expression:
sql:INSERT INTO `requisitions` ( `itemID`, `quantity`, `rejected`) VALUES ( ${itemID}, ${quantity}, "no" );


Service task with the expression:
sqlSmiley FrustratedELECT last_insert_id()

Now, the variable resulting from the second query is 0.
What is going wrong here?
1 REPLY 1

jbarrez
Star Contributor
Star Contributor
You have a service task with an SQL expression? Or how must I see that? How do you fetch this data?

I don't see why executing custom SQL shouldn't work from within Activiti … it's all jdbc in the end.