Creating a SQL Anywhere or Sybase IQ User-Defined Datatype

Create a datatype based on the available datatypes for your data server.

Prerequisites 

Before you can create a user-defined datatype, be sure the appropriate data server is running, and you created and established a connection to the data server.

  1. In the Databases folder in Enterprise Explorer, under the database connection profile, expand the tree for a database, expand the Schemas folder and then the tree for the appropriate schema owner.
  2. Right-click the User Defined Types folder, and select New > User Defined Type .
  3. Enter the Name.
  4. Provide settings for the new type.
    Setting Description
    System Datatype Select a base datatype.
    Null Value Setting Specify the null-value setting. The default is to use the database null-value setting.
    Has Default Value Select Has Default Value to specify a default value for this datatype.
    • User-Defined – select this option to specify your own default for this datatype, and enter a default value in the corresponding text field. To specify this value as a literal string, select Literal string.
    • System-Defined– select this option to specify a system-defined default value, and select Autoincrement or Global Autoincrement. If necessary, specify a partition size.
    Check Constraint (Optional) Enter a check constraint for data of this datatype.
  5. Click Next and specify save and execution properties.
    Field Description
    Generate Script Generate a SQL file for the object.
    Enter or Select the Parent Folder Specify an existing project or create a new project in which to save the SQL file.
    File Name Enter the file name in which to store the SQL code.
    Execute Immediately Execute the SQL code immediately. If you do not select this option, you must complete execution of the SQL file later to create the object.
    Open in Editor After Creation Create the object and open it in its associated editor.
  6. Click Finish to create the datatype.
Related concepts
User-Defined Type Editor
User-Defined Datatypes
Related tasks
Creating an ASE User-Defined Datatype
Editing a SQL Anywhere or Sybase IQ User-Defined Datatype
Editing an ASE User-Defined Datatype
Renaming a User-Defined Datatype
Dropping a User-Defined Datatype
Opening a Referenced Database Object


Created June 25, 2009. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com