To do this you need to use a function. Because sqlite does not support user functions you need to write one in your application. That means the easiest way to realize what you want is to build up a insert SQL statement through a loop and execute it.
solved SQLite: how to fill new column with values? [closed]