DB_Table.select_into_database_table
select_into_database_tableconnectiontable_name primary_keytemporaryon_problems
Group: Output
Documentation
Creates a new database table from this table.
Arguments
connection: the database connection to use. The table will be created in the database and schema associated with this connection.table_name: the name of the table to create.primary_key: the names of the columns to use as the primary key. The first column from the table is used by default. If it is set toNothingor an empty vector, no primary key will be created.temporary: if set toTrue, the table will be temporary, meaning that it will be dropped once theconnectionis closed. Defaults toFalse.on_problems: the behavior to use when encountering non-fatal problems. Defaults to reporting them as warning.
Errors
- If a table with the given name already exists, then a
Table_Already_Existserror is raised. - If a column type is not supported and is coerced to a similar supported
type, an
Inexact_Type_Coercionproblem is reported according to theon_problemssetting. - If a column type is not supported and there is no replacement (e.g.
native Enso types), an
Unsupported_Typeerror is raised. - If the provided primary key columns are not present in the source table,
Missing_Input_Columnserror is raised. - If the selected primary key columns are not unique, a
Non_Unique_Keyerror is raised. - An
SQL_Errormay be reported if there is a failure on the database side.
If an error has been raised, the table is not created (that may not always
apply to SQL_Error).
Remarks
Dry Run if Output disabled
If performing output actions is disabled, only a dry run is performed and
no permanent changes occur. The operation checks for errors like missing
columns, and returns a temporary table containing a sample of the input
with a Dry_Run_Operation warning attached.
More expensive checks, like clashing keys are checked only on the sample of rows, so errors may still occur when the output action is enabled.