Closed
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
The global temporary table is not deleted after running the model due to an
[dbt-oracle/blob/main/dbt/include/oracle/macros/adapters.sql](
)example:
create global temporary table TEST (object_id number, object_name varchar2(30)) on commit PRESERVE rows;
Such tables get bound to the session with the first insert and then this binding is ONLY removed when the session exits or by truncate. If the binding exists DDL cannot be performed on these temporary tables and if you try a DDL on such tables you would receive ORA-14452 attempt to create, alter or drop an index on temporary table already in use.
add before
{% for rel in to_drop %}
{% do adapter.truncate_relation(rel) %}
{% endfor %}
Expected Behavior
drop table
Steps To Reproduce
- create model materialized='incremental'
Relevant log output using --debug
flag enabled
No response
Environment
- OS:MacOs
- Python:3.9
- dbt-core: 1.1.0
What Oracle database version are you using dbt with?
12.1.0
Additional Context
No response