Alters the SELECT query of an existing, non-materialized view.

Syntax

CREATE [ temp / temporary ] TABLE tableName
AS SELECT selectQuery ;

Arguments

  • temp / temporary: Requires creation of a temporary table.

    • If temp or temporary is not included, this table will not be a temporary table.

    • Temporary tables that are created do not make use of the underlying system’s temporary table mechanism.

    • Temporary tables created will be managed by the Cirro Data Hub, and are automatically dropped when the connection they were created in has been closed.

  • tableName: The name for the table.

    • If there is a remote system specified as part of tableName, Cirro will create the table on that system.

    • Otherwise, the table will be created on the system identified by Cirro to be the most efficient or desirable placement.

  • selectQuery: A SELECT query defining the source data for the table.

Additional Information

  • The column count and data types in the new table will match the select statement.

Examples

Creates a temp table on a system of the Cirro Data Hub’s choosing

CREATE temp TABLE myTable
AS SELECT id, firstName, lastName FROM MYSQL.inventory.users2011;

Creates a table on Oracle using MySQL source data

CREATE TABLE ORACLE1.ORACLE.CIRRO.sample_permanent
AS SELECT * FROM MYSQL.inventory.myusers;

See Also