![]()
![]() ![]() ![]() ![]() ![]() ![]() ![]() Documentation Top ![]() Global Index ![]() Reference Manual ![]() ![]() ![]() Developer's Guide ![]() ![]() Tuning Cloudscape ![]() ![]() |
CREATE TABLE statementA CREATE TABLE statement creates a table. Tables contain columns and constraints that specify a column or columns. Columns have a data type and can specify column constraints. (A constraint is a rule to which data must conform.) For information about constraints, see CONSTRAINT clause. You can specify a default value for a column. A default value is the value to be inserted into a column if no other value is specified. If not explicitly specified, the default value of a column is NULL. NEW: The ability to specify a default for a column is new in Version 3.0. The SET LOCKING clause allows you to override row-level locking for the specific table, if your system is set for row-level locking. (If your system is set for table-level locking, you cannot change the locking granularity to row-level locking.) To override row-level locking for the specific table, set locking for the table to TABLE. After you create such a table, you can change locking back to ROW with the a SET LOCKING clause in the ALTER TABLE statement. NEW: The SET LOCKING clause is new in Version 3.0. You can specify storage properties such as page size for a table with a PROPERTIES clause. Tables cannot be created in the SYS schema. Syntax
ColumnDefinition
The syntax of DataType is described in Data Types. The syntaxes of Column-Level Constraint and Table-Level Constraint are described in CONSTRAINT clause. Column DefaultsFor the definition of a default value, a ConstantExpression is an expression that does not refer to any table. It can include literals, built-in functions such as USER, CURRENT_DATE, CURRENT_TIME, and CURRENT_TIMESTAMP, java method invocations, java field references, and any other expression, as long as it does not refer directly to a table or to a column in a table. (If the default table contains a method call, the method may in fact contain SQL-J statements that refer to tables and columns.) A method call cannot contain dynamic parameters (?). In a Cloudscape synchronization system, non-literal defaults are re-evaluated at the source if the insert or updated statement is executed within a work unit. Examples
NOTE: For more examples of CREATE TABLE statements using the various constraints, see CONSTRAINT clause. Interaction with Java Data TypesYou can create columns that store Java objects. For more information, see Java Data Types (User-Defined Data Types). You can store SQL NULL values in Java data type columns (assuming that the columns do not have NOT NULL constraints). (An SQL NULL value is not the same thing as a Java null reference, although they do map to one another.) Published TablesWhen a table is published, it has the same lock granularity at the target as at the source. The SET LOCKING clause of the CREATE TABLE and ALTER TABLE statements is implicitly published to the targets whose publication includes the affected table. Column defaults are always implicitly published if a column is published. A column in a target cannot have a different default value than the corresponding column in the source. | ||
![]() ![]() ![]() ![]() ![]() ![]() | ![]() ![]() Cloudscape Version 3.0 ![]() For technical support, go to: www.cloudscape.com and click Support. Copyright © 1998 and 1999 Cloudscape, Inc. All rights reserved. |