Medium severitydata integrity
Power BI Refresh Error:
1364
What does this error mean?
An INSERT statement omits a NOT NULL column that has no DEFAULT value defined.
Common causes
- 1A new NOT NULL column was added to the table without a default value, breaking existing INSERT statements
- 2ADF column mapping does not include the new required column
- 3dbt model SELECT does not include all NOT NULL columns
- 4strict_mode is enabled (STRICT_TRANS_TABLES) — MySQL enforces NOT NULL constraints strictly
How to fix it
- 1Step 1: Add a DEFAULT value to the column: `ALTER TABLE your_table ALTER COLUMN new_col SET DEFAULT 'default_value';`
- 2Step 2: Or update INSERT statements to include the column: `INSERT INTO your_table (col1, col2, new_col) VALUES (1, 'a', 'default');`
- 3Step 3: Update the ADF sink column mapping to include the new column.
- 4Step 4: In dbt, add the column to the model SELECT with a default expression: `COALESCE(source_col, 'default') AS new_col`.
Frequently asked questions
Official documentation: https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html