• Quick thought, place the function in a cte and use the output in the insert.

    😎