Creating a Table with No Partitions in the IQ (Catalog) System Store

A base table holds persistent data. (The table and its data continue to exist until you explicitly delete the data or drop the table.)

Prerequisites
Database Version Table Privileges
SAP Sybase IQ 15.3 and 15.4 Base table to be owned by self – you must have RESOURCE authority with CREATE permission on the main store dbspace in which the table is created.

Base table to be owned by any user – you must have DBA authority.

SAP Sybase IQ 16.0 Base table to be owned by self – you must have CREATE permission on the dbspace where the table is created. You must also have one of:
  • CREATE TABLE system privilege
  • CREATE ANY OBJECT system privilege
Base table to be owned by any user – you must have CREATE permission on the dbspace where the table is created. You must also have one of:
  • CREATE ANY TABLE system privilege
  • CREATE ANY OBJECT system privilege
Task

Altering or creating base tables can interfere with other users of the database.

For large tables, modifying an existing table or creating a new table can be a time-consuming operation. The internal CREATE TABLE statement delays execution of other processes until the statement completes. Although you can modify tables while other connections are active, you cannot execute them while any other connection uses the table to be altered. Modifying a table excludes other requests referencing the table being offered while the internal ALTER TABLE statement processes.

  1. In the Perspective Resources view, select the resource, and select Resource > Administration Console.
  2. In the left pane, expand IQ Servers > Schema Objects > Tables, and then select Tables.
  3. Click the arrow next to Tables and select New.
    The Create Table wizard appears.
  4. On the Welcome page, specify:
    Option Description
    Select a resource for which the table will be created From the list, select the resource for which the table will be created.
    What do you want to name the table? Enter a name for the new table; maximum of 128 characters.
    Which user do you want to own the table? From the list, select the user to own the table.
  5. Click Next.
  6. On the Dbspace page, select IQ system store and the dbspace in which the table will be created. Only those dbspaces to which you have permissions are listed. Click Next.
  7. On the Primary Key Constraints page, enter primary key constraint information. Default is to create a primary key constraint with no clustered primary key. Click Next.
  8. On the Free Space page, enter free space information. Default is to reserve 200 bytes for each table page. Click Next.
  9. On the Columns page, each row in the Column Definitions table corresponds to a column in the table. To add column definitions for the table, click New, and follow the Create Column wizard prompts.
    1. On the Column Name page, specify the name of the column and indicate whether the column is to be a primary key column. Click Next.
    2. On the Data Type page, specify:
      Option Description
      Built-in type (Default is bigint) Choose a predefined data type for the column. Integers, character strings, and dates are examples of predefined data types. For some of these types, you can specify size and scale.
      • Size – length of string columns, or the total number of digits to the left and right of the decimal point in the result of any decimal arithmetic for numeric columns. For numeric columns, the size is also called the PRECISION value.
      • Scale – minimum number of digits after the decimal point when an arithmetic result is truncated to the maximum PRECISION value.
      • Units – unit corresponding to the data type's size. Possible units include: bits, bytes, characters, or digits. For CHAR and VARCHAR data types, you can specify the unit as bytes or characters.
      • Compress values – (Not available for all built-in types) Select to compress column values. If a column is compressed, database server activities such as indexing, data comparisons, and statistics generation may be slightly slower if they involve the compressed column because the values must be compressed when written, and decompressed when read.
      • Maintain BLOB indexes for large values – (Available for character and binary types only) Maintain BLOB indexes for large values.
      Domain Choose a domain. A domain is a named combination of built-in data types, default value, check condition, and nullability.
    3. Click Next.
    4. On the Value page, specify:
      Option Description
      No default or computed value (Default) Select this option if the column is not a computed value and has no default value.
      Default Value Select this option if the column has a default value. If the column is based on a domain, this setting inherits the domain's default value (if any), but you can override the value for the column.
      • User-defined – type a custom value (string, number, or other expression) for the default value. If you have based the column on a domain, you can retain the domain's default value (if any), or override it for the column.
        • Literal string – specify whether the default value for the column should be treated as a literal string. By default, this option is selected for character columns and domains with a character base type. You do not need to enclose default text in single quotes, and escape embedded single quotes or backslashes in the string.
      • System-defined – (List depends by data type specified) Lets you select a predefined value (for example, current date) for the default value. If you have based the column on a data type of Domain, you can retain the domain's default value (if any) or override it for the column.

        If you select Global autoincrement, specify a size. The domain of values for that column is partitioned. Each partition contains the same number of values.

        For example, if you set the partition size for an integer column in a database to 1000, one partition extends from 1001 to 2000, the next from 2001 to 3000, and so on.

      Computed Value Define a computed value for the column. A computed column derives its values from calculations of values in other columns. Type an expression in the text box to describe the relationship between the other columns and the value that appears in the computed column.
    5. Click Next.
    6. On the Constraints page, specify:
      Option Description
      Values can be null (Default) Select this option if null values are allowed in the column. If the column is based on a domain, you can retain the domain's nullability or override it for the column.
      Values cannot be null Select this option to allow duplicate values, but not allow null values in this column.
      Values cannot be null and must be unique Select this option if values in the column cannot be null and must be unique.
    7. Click Next.
    8. (Optional) On the Comment page, add a descriptive comment for the column. Comments help you organize your database.
    9. Click Finish to create the column.
    10. Repeat these steps to create additional columns. When all columns are added, click Next.
  10. (Optional) On the Comment page, enter a comment about the table.
  11. Click Finish.
Related concepts
Table Columns
Table Permissions
Table Constraints
Table Indexes
Table Triggers
Table Partitions
Related tasks
Creating a Table with No Partitions in the IQ Main Store
Creating a Table with a Hash Partition
Creating a Table with a Range Partition
Creating a Table with a Hash-Range Partition
Creating a Global Temporary Table
Creating a Proxy Table
Viewing Table Data in the Execute SQL Window
Deleting a Table
Generating Table DDL Commands
Moving a Table to Another Dbspace
Validating a System Store Table
Setting the Primary Key
Setting a Clustered Index
Merging Table Data from RLV Store with IQ Main Store
Calculating the Number of Rows in a Table
Moving Table Objects to Another Dbspace
Enabling or Disabling Row-Level Versioning in a Table
Viewing or Modifying Base Table Properties
Viewing or Modifying Global Temporary Table Properties
Viewing and Modifying Proxy Table Properties
Related reference
Table Privilege Summary