CREATE SCHEMA

<< Click to Display Table of Contents >>

Navigation:  Streaming SQL Reference Guide > CREATE statements >

CREATE SCHEMA

Previous pageReturn to chapter overviewNext page

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-scale schemas in s-Server instead of defining all objects under a few large-scale schemas. This lets you reuse and drop schemas as you need them.

Syntax Chart

create_schema01

For create_command, drop_command, set_command, and alter_command, see the corresponding topics in this guide.

oALTER is also discussed in the topics Configuring SQLstream and Managing and Monitoring in the s-Server Administrator Guide.
oSET is also discussed at in the topic SessionManagement in the Admin Guide.

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

oCHECKPOINT 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.