Skip to content

[Bug] ORA-00942 insert data to another schema #14

@AlexMorti

Description

@AlexMorti

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

test model:

`{{ config(
materialized='incremental',
schema='rt_ailin'
)
}}

SELECT
11235 as id,
'alex' as first_name,
'morti' as last_name
FROM dual`

data is not inserted into another schema

START incremental model rt_ailin.customers............................... [RUN]
oracle adapter: Oracle error: ORA-00942: table or view does not exist
1 of 1 ERROR creating incremental model rt_ailin.customers...................... [ERROR in 0.33s]

logs:
another_schema.log

The error is due to the fact that the script replaces the current schema, and the schema is not needed because the global temporary table is created in the current schema anyway

{% set tmp_relation = base_relation.incorporate(
path={"identifier": tmp_identifier}) -%}

fix:
{% set tmp_relation = base_relation.incorporate( path={"identifier": tmp_identifier, "schema": None}) -%}

logs after fix
dbt.log

Expected Behavior

START incremental model rt_ailin.customers............................... [RUN]
OK created incremental model rt_ailin.customers.......................... [OK in 0.49s]

Steps To Reproduce

No response

Relevant log output using --debug flag enabled

No response

Environment

- OS:MacOs
- Python:3.9
- dbt-core: 1.0.7

What Oracle database version are you using dbt with?

12.1.0

Additional Context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions