{#- Redshift: capture scalar output parameters from a procedure that
    also has cursor params.  Wraps the CALL in a BEGIN/END block with
    DECLARE for scalar OUT variables, then SELECTs their values.
    Invoked once when the procedure has both scalar outputs and cursors. -#}
BEGIN
{% if pre_execute %}
DECLARE
{{ pre_execute }}
{% endif %}
{{ run }};
SELECT {% for out in outputs %}{{ out }} AS "{{ out }}"{% if not loop.last %}, {% endif %}{% endfor %};
END;
