Column description with like in import statements
Details
| Detail name | Value |
|---|---|
| Changelog Number | 5633 |
| Type | Improvement |
| Status | Resolved |
| Fix Versions | Exasol 6.1.0 |
| Resolution Date | 2018-02-05 |
Background
Exasol supports like clauses to create a new table with the same data types as an already defined one. The use of this clause was restricted to the CREATE TABLE statement.
Feature description
We have introduced the like clause in IMPORT statements and subimport clauses. As for the CREATE TABLE statement, it is possible to combine several like clauses.
Example:
CREATE SCHEMA TEST; create or replace table t1 (a int, b int, c char(1), d double); insert into t1 values (1, 2, 'c', 4.4); export t1 into local csv file '/tmp/test.csv'; create table t2 (a int, b int); create table t3 (d double); IMPORT INTO (like t2, c char(1), like t3) FROM LOCAL CSV FILE '/tmp/test.csv';
Benefits
It is no longer necessary to manually specify all column names and data types for an import into a temporary table.
Restrictions
The combined column definition has to be compatible with the imported data.