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. Right-click the User Defined Types folder, and choose New > User Defined Type.

    The New User Defined Type page appears.

  2. Enter the datatype name in the Name field.
  3. Provide settings for the new type.
    Setting Description
    System datatype Select a base datatype from the drop-down list.
    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 from the corresponding drop-down. If necessary, specify a partition size.
    Check constraint (Optional) Enter a check constraint for data of this datatype.
  4. Click Next, and specify save and execution properties for the datatype.
    Field Description
    Generate script Select this option to generate the script for the datatype.
    Enter or select the parent folder Specify an existing project or create a new project in which to save the SQL.
    File name Enter the name of the file in which to store the SQL.
    Execute immediately Execute the SQL immediately. If you do not select this option, you must complete execution of the SQL later to create the datatype.
    Open in editor after creation Create the datatype, and then open it in the User Defined Type Editor.
  5. 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

Send your feedback on this help topic to Sybase Technical Publications: pubs@sybase.com

Your comments will be sent to the technical publications staff at Sybase, Inc. For product-related issues or technical support, contact Sybase Technical Support at 1-800-8SYBASE.