diff --git a/docs/en/operations/settings/settings.md b/docs/en/operations/settings/settings.md index 32b037eff25..74432811512 100644 --- a/docs/en/operations/settings/settings.md +++ b/docs/en/operations/settings/settings.md @@ -366,16 +366,18 @@ throws an exception. ## input_format_null_as_default {#settings-input-format-null-as-default} For text input formats initialize `NULL` fields with default values if data type of this field is not nullable. +This setting is applied to `INSERT ... VALUES` queries. ## insert_null_as_default {#insert_null_as_default} -Enables the insertion of [default values](../../sql-reference/statements/create/table.md#create-default-values) instead of [NULL](../../sql-reference/syntax.md#null-literal) into non-[Nullable](../../sql-reference/data-types/nullable.md#data_type-nullable) columns. This setting is applied to `INSERT ... SELECT` [queries](../../sql-reference/statements/insert-into.md#insert_query_insert-select). `SELECT` subqueries may be concatenated with `UNION ALL` clause. -If column type is Nullable then `NULL` values are inserted as is. -If column type is non-Nullable and this setting is disabled, then inserting `NULL` causes an exception. +Enables the insertion of [default values](../../sql-reference/statements/create/table.md#create-default-values) instead of [NULL](../../sql-reference/syntax.md#null-literal) into clumns with not [nullable](../../sql-reference/data-types/nullable.md#data_type-nullable) data type. +This setting is applied to `INSERT ... SELECT` [queries](../../sql-reference/statements/insert-into.md#insert_query_insert-select). Note that `SELECT` subqueries may be concatenated with `UNION ALL` clause. +If column type is nullable then `NULL` values are inserted as is regardless of this setting. +If column type is not nullable and this setting is disabled, then inserting `NULL` causes an exception. Possible values: -- 0 — Inserting `NULL` into a non-Nullable column causes an exception. +- 0 — Inserting `NULL` into a not nullable column causes an exception. - 1 — Default column value is inserted instead of `NULL`. Default value: `1`. diff --git a/docs/en/sql-reference/statements/insert-into.md b/docs/en/sql-reference/statements/insert-into.md index 59e8a958f48..a061b83eb04 100644 --- a/docs/en/sql-reference/statements/insert-into.md +++ b/docs/en/sql-reference/statements/insert-into.md @@ -98,7 +98,7 @@ INSERT INTO [db.]table [(c1, c2, c3)] SELECT ... Columns are mapped according to their position in the SELECT clause. However, their names in the SELECT expression and the table for INSERT may differ. If necessary, type casting is performed. -To insert a default value instead of `NULL` into non-Nullable column enable [insert_null_as_default](../../operations/settings/settings.md#insert_null_as_default) setting. +To insert a default value instead of `NULL` into a column with not nullable data type enable [insert_null_as_default](../../operations/settings/settings.md#insert_null_as_default) setting. None of the data formats except Values allow setting values to expressions such as `now()`, `1 + 2`, and so on. The Values format allows limited use of expressions, but this is not recommended, because in this case inefficient code is used for their execution.