Contents IndexCREATE DATATYPE statement CREATE FUNCTION statement

User's Guide
   Part VI. SQL Anywhere Reference
     Chapter 43. Watcom-SQL Statements
      CREATE DBSPACE statement

Function

To create a new database file. This file may be on a different device.

Syntax

     CREATE DBSPACE dbspace-name AS filename

Usage

Anywhere.

Permissions

Must have DBA authority.

Side effects

Automatic commit.

See also

Description

The CREATE DBSPACE statement creates a new database file. When a database is first initialized using DBINIT, it is composed of one file. All tables and indexes created are placed in that file. CREATE DBSPACE adds a new file to the database. This file can be on a different disk drive than the root file allowing the creation of databases larger than one physical device.

The dbspace-name is an internal name for the database file. The filename is the actual name of the database file, with a path where necessary.

A filename without an explicit directory is created in the same directory as the main database file. Any relative directory is relative to the main database file. When you are using a SQL Anywhere, the filename is a filename on the server machine. When you are using the SQL Anywhere Server for NetWare, the filename should use a volume name (not a drive letter) when an absolute directory is specified.

Each table, including its associated indexes, is contained entirely within one database file. The IN clause of the CREATE TABLE statement the dbspace into which a table is placed. Tables are put into the root database file by default.

Example

Create a dbspace called library to hold the LibraryBooks table and its indices.

     CREATE DBSPACE library
     AS 'e:\dbfiles\library.db' ;
     CREATE TABLE LibraryBooks (
     title char(100),
     author char(50),
     isbn char(30),
     ) IN library ;

Contents IndexCREATE DATATYPE statement CREATE FUNCTION statement