Translations of this page?:

Create Table

Creates a new database table.

Sample

<createTable tableName="person">
    <column name="id" type="int">
        <constraints primaryKey="true" nullable="false"/>
    </column>
    <column name="firstname" type="varchar(255)"/>
    <column name="lastname" type="varchar(255)"/>
    <column name="username" type="varchar(255)">
      <constraints unique="true" nullable="false"/>
    </column>
     <column name="testid" type="int" />
</createTable>

Available Attributes

tableName Name of the table to create [required]
schemaName Name of the table schema
tablespace “Tablespace” (file group in SQL Server) to create the table in

Available Sub-Tags

column Column(s) to create in the table. The Column tag can contain constraint and foreign key information. See the column tag documentation for more information [required]

Database Compatiblity

MySQL
PostgreSQL No Issues
Oracle No Issues
MS-SQL No Issues
Sybase No Issues
DB2 No Issues
Derby Does not support tablespaces
HSQL Does not support tablespaces
H2 Does not support tablespaces
Caché Does not support tablespaces
Firebird No Issues
MaxDB No Issues

Automatic Rollback Support: YES

 
manual/create_table.txt · Last modified: 2008/03/18 07:08 (external edit)     Back to top