techindicium / dbt-oracle

A dbt adapter for oracle db backend
Other
38 stars 18 forks source link

An dbt-oracle Macro does not execute multiple statements (separated by semicolon) #26

Open gbonazzoli opened 3 years ago

gbonazzoli commented 3 years ago

Description

This macro works:

{% macro grant_select() %}

{% set sql %}
    grant select on orders to psofa
{% endset %}

{% do run_query(sql) %}
{% do log("Privileges granted", info=True) %}

{% endmacro %}

This macro does not work:

{% macro grant_select() %}

{% set sql %}
    grant select on orders to psofa;
    grant select on orders to psofa;
{% endset %}

{% do run_query(sql) %}
{% do log("Privileges granted", info=True) %}

{% endmacro %}

and gives the following error:

Oracle error: ORA-00933: SQL command not properly ended
Rolling back transaction.
Encountered an error while running operation: Database Error
  ORA-00933: SQL command not properly ended