This works fine:
insert into Genres (ID, Genre)
select 1 AS ID, 'Action' AS Genre
union select 2, 'Adventure'
...and this works fine:
insert into Movies_Genres (ID, MovieID, GenreID)
select 1 AS ID, 2 AS MovieID, 1 AS GenreID
union select 2, 3, 1
...but when I try to combine the two statements:
insert into Genres (ID, Genre)
select 1 AS ID, 'Action' AS Genre
union select 2, 'Adventure'
insert into Movies_Genres (ID, MovieID, GenreID)
select 1 AS ID, 2 AS MovieID, 1 AS GenreID
union select 2, 3, 1
...it throws an error. I also tried separating the 2 table batches by a semicolon, but also got an error. "An error occured parsing the provided SQL statement." And "syntax error". I have a large amount of inserts to do, so I need to maximize performance, and I have found this approach very robust and fast:
How to insert multiple rows into a SQLite 3 table?
So, what is the proper syntax to batch together a bunch of inserts aimed at different tables?