{% macro delete_users() %}
{%- set empDelId = get_emp_id_to_delete() %}
DELETE FROM {{ source(‘myWIsource’, ‘Employees’) }} where employee_di = {{ empDelId }}
{% endmacro %}
Or you could just call the get_emp_id_to_delete macro from your pre-hook:
{{
config(materialized = ‘incremental’,
pre_hook = [ “DELETE FROM {{ source(‘myWIsource’, ‘Employees’) }} where employee_di = {{ get_emp_id_to_delete() }}”
]
}}