Create pgSQL function and use it in the etl scenario. Use Scenario global variable