The following solution mimics your task by calling the first SQL statement and using the elements of the result set of that statement as parameter to call a second SQL statement.

In the second table input the ?
is used as a placeholder for the parameter. Kettle seems to map incoming fields sequentially. In this case the field schema_name
is the first field so it will be assigned to the first parameter. Any additional incoming field would be mapped accordingly. Note that the number of incoming fields and the number of used parameters in the SQL statement must match. Otherwise a run-time error will be raised. Also note that the ?
in my solution may be specific to the MySQL syntax. From the naming pattern in your SQL statement I would assume that you are using a MS SQL Server. So the actual placeholder may be named differently.
The second table input must be configured as follows:

Note that in this case it is not necessary to mark Replace variables in script since the parameters are not regarded as variables. The entries Insert data from step and Execute for each row, however, must be set appropriately.