CREATE SCHEMA

As with RDBMS tables, you create streams, tables, views, pumps, procedures, and user defined functions within a schema. In streaming SQL, as elsewhere, schemas function as namespaces. Because of the complex nature of streaming systems, it may be advantageous to create a number of small->drop schemas* as you need them.

Syntax Chart

For checkpoint, savepoint, rollback, and commit commands, see Session Management in the Admin Guide.

CHECKPOINT is also discussed in the topic Backups and Code Control in the Admin Guide.

Example

Simple schema creation: CREATE SCHEMA Trading;

Creating a schema and all its contents:

CREATE SCHEMA Trading
DESCRIPTION 'Contains the equity trades application objects';
SET SCHEMA '"Trading"';
CREATE STREAM "TRADES" (
"Ticker" VARCHAR(5) NOT NULL,
"Shares" INTEGER,
"Price" DECIMAL(6,2) );

Limitations

  • The AUTHORIZATION clause is currently parsed but ignored.
  • To set the path, e.g., for lookup of user-defined functions and procedures, see subtopic SET PATH in the topic - SET statements* in this guide.