SQL Statement Type | Tasks |
---|---|
Data Definition | Create, modify, and delete tables. Create and delete views. Create and delete indexes. Create and delete stored SQL procedures. Create and delete triggers. Create and delete user-defined functions. |
Data Manipulation | Retrieve, insert, update, and delete data in tables. Define transactions. Define and delete views. Execute stored SQL procedures. Execute triggers. |
Data Control | Enable and disable security for a dictionary. Create and delete users. Add and drop users from groups. Change user passwords. Grant and revoke table access rights. |
Defines a table and optionally creates the corresponding data file. | |
Changes a table definition. With an ALTER TABLE statement, you can perform such actions as add a column to the table definition, remove a column from the table definition, change column data type or length (or other characteristics), add or remove a primary key or a foreign key, and associate the table definition with an different data file. | |
Deletes a table from the data dictionary and optionally deletes the associated data file. |
Defines a new view. | |
Deletes a view. |
Defines a new index (a named index) for an existing table. | |
Deletes a named index. |
Defines a trigger for an existing table. | |
Deletes a trigger. |
BEFORE | Defines the trigger execution before the INSERT, UPDATE, or DELETE operation. |
AFTER | Defines the trigger execution after the INSERT, UPDATE, or DELETE operation. |
Stores a new procedure in the data dictionary. | |
Deletes a stored procedure from the data dictionary. |
IF...THEN...ELSE | Provides conditional execution based on the truth value of a condition. |
Continues execution by leaving a block or loop statement. | |
Repeats the execution of a block of statements. | |
Repeats the execution of a block of statements while a specified condition is true. |
Creates a scalar user-defined function in the database. | |
Deletes a scalar user-defined function from the database. |
Retrieves data from one or more tables in the database. |
FROM | Specifies the tables or views from which to retrieve data. |
WHERE | Defines search criteria that qualify the data a SELECT statement retrieves. |
Combines sets of rows according to the criteria you specify and allows you to determine aggregate values for one or more columns in a group. | |
Allows you to limit a view by specifying criteria that the aggregate values of a group must meet. | |
ORDER BY | Determines the order in which Zen returns selected rows. |
Adds rows to one or more tables or a view. | |
Changes data in a table or a view. | |
Deletes rows from a table or a view. |
Defines a database view and stores the definition in the dictionary. | |
Deletes a view from the data dictionary. |
CALL or EXEC[UTE] | Recalls a previously compiled procedure and executes it. |
CALL or EXEC[UTE] | Recalls a system stored procedure and executes it. |
Enables or disables security for the database and sets the Master password. |
ALTER USER | Rename a user or change a password. |
CREATE USER | Creates a new user with or without a password or membership in a group. |
DROP USER | Delete a user. |
ALTER GROUP | Adds users to a group. Drops users from a group. |
CREATE GROUP | Creates a new group of users. |
DROP GROUP | Deletes a group of users. |
GRANT LOGIN TO | Creates users and passwords, or adds users to groups. |
REVOKE LOGIN FROM | Removes a user from the dictionary. |
GRANT (access rights) | Grants a specific type of rights to a user or a group. The rights you can grant with a GRANT (access rights) statement are All, Insert, Delete, Alter, Select, Update, and References. |
GRANT CREATETAB TO | Grants the right to create tables to a user or a group. |
REVOKE (access rights) | Revokes access rights from a user or a group. |
REVOKE CREATETAB FROM | Revokes the right to create tables from a user or a group. |
Zen Feature | Limit or Condition | Metadata | |
---|---|---|---|
V1 | V2 | ||
Arguments in a parameter list for a stored procedure | 300 | X | X |
CHAR column size | 8,000 bytes1 | X | X |
Character string literal | See String Values. | X | X |
Columns in a table | 1,536 | X | X |
Columns allowed in a trigger or stored procedure | 300 | X | X |
Column name2 | 20 bytes | X | |
128 bytes | X | ||
Column size | 2 GB | X | X |
Correlation name | Limited by memory | X | X |
Cursor name | 18 bytes | X | X |
Database name2 | 20 bytes | X | X |
Database sessions | Limited by memory | X | X |
Data file path name | 64 bytes (the maximum length of the data file path name is a combination of Xf$Loc path and the data file path) | X | |
250 bytes (the maximum length of the data file path name is a combination of Xf$Loc path and the data file path) | X | ||
Function (user-defined) name2 | 30 bytes | X | |
128 bytes | X | ||
Group name2 | 30 bytes | X | |
128 bytes | X | ||
Index name2 | 20 bytes | X | |
128 bytes | X | ||
Key name2 | 20 bytes | X | |
128 bytes | X | ||
Label name | limited by memory | X | X |
NCHAR column size | 4,000 UCS-2 units (8,000 bytes1) | X | X |
NVARCHAR column size | 4,000 UCS-2 units (8,000 bytes1) | X | X |
Number of ANDed and ORed predicates | 3000 | X | X |
Number of database objects | 65,536 | X | |
4 billion | X | ||
Parameter name | 126 bytes | X | X |
Password2 | 8 bytes | X | |
128 bytes | X | ||
Procedure name2 | 30 bytes | X | |
128 bytes | X | ||
Referential integrity (RI) constraint name | 20 bytes | X | |
128 bytes | X | ||
Representation of single quote | Two consecutive single quotes ('') | X | X |
Result name | Limited by memory | X | X |
Savepoint name | Limited by memory | X | X |
SELECT list columns in a query | 1,600 | X | X |
Size of a single term (quoted literal string) in a SQL statement | 14,997, excluding null terminator and quotations (15,000 total) | X | X |
SQL statement length | 512 KB | X | X |
SQL statements per session | Limited by memory | X | X |
Stored procedure size | 64 KB | X | X |
Table name2 | 20 bytes | X | |
128 bytes | X | ||
Table rows | 13.0 or 16.0 file format: 9,223,372,036,854,775,807 (~9.2 quintillion) Older file formats: 2,147,483,647 (~2.1 billion) | X | X |
Joined tables per query | Limited by memory | X | X |
Trigger name2 | 20 bytes | X | |
128 bytes | X | ||
User name2 | 30 bytes | X | |
128 bytes | X | ||
VARCHAR column size | 8,000 bytes1 | X | X |
Variable name | Limited by memory | X | X |
View name2 | 20 bytes | X | |
128 bytes | X | ||
1The maximum size of a CHAR, NCHAR, VARCHAR or NVARCHAR column that may be fully indexed is 255 bytes, or 1024 bytes in a 16.0 format file. |