Get Last ID, Insert Into Other Table

I want to do this

get value from multiple select as newRefs;

insert into table1 ('name') values ('pete');

SELECT LAST_INSERT_ID() as newUserId;

for each (currentRef in newRef) {

     insert into lookupTable1 (userId,ref) values (newUserId,currentRef);

}

Actually there is a quicker way to do this with MySQL/MariaDB as noted here
https://dev.mysql.com/doc/refman/8.0/en/insert.html

What do I need to do this?
Do I use Data Store Entities, Record Types, etc.?
I can't be the first one that want to do something like this.

  Discussion posts and replies are publicly visible

Parents Reply
  • Personally I'm going to call this a bug, even though it's probably not, but after 10+ hours of trying to getting something done which can be done in 30 minutes or less in C# or Java seems like a bug/problem to me.
    You can see that the record is saved, but itemId a process variable never gets it's correct value

    It's a pretty simple process model as shown below, and the process variable is being set on the Outputs tab of the note.

    I've taken out the second write records to make this model even more simple

Children