Create parameter(s) from SQL Query

You can use the “First column value” mode as described in this topic: Using "First value of column" for file path when exporting - how can we use it? - #4 by dgudkov