Transactional behavior of CREATE TABLE ... AS in Big SQL

When you run a CREATE TABLE statement that contains an AS full-select clause, the statement is processed as two separate statements: a CREATE TABLE and an INSERT or SELECT.

The two statements are run in sequence, independently of each other.

Even though the CREATE TABLE statement completes successfully, it might be possible for the INSERT or SELECT statement to cause an error. The CREATE TABLE will automatically commit, and the empty table is created in the database. You can do either of the following actions after you correct the error that caused the INSERT of SELECT statement to fail:
  • Run the INSERT or SELECT statement on the table.
  • Drop the table, and run the CREATE TABLE AS statement again.