Generating Data Definition Language

Use the Generate DDL wizard to generate DDL for database objects.

  1. Right-click a database or database object, and choose Generate DDL from the context menu.
  2. Specify DDL generation options.
    Table 1. Generate options
    Option Data servers Description
    CREATE Statements
    • ASE
    • SQL Anywhere
    • Sybase IQ
    Generate SQL create statements.
    DROP Statements
    • ASE
    • SQL Anywhere
    • Sybase IQ
    Generate SQL drop statements. DROP statements remove an existing object from the database.
    Fully Qualified Name
    • ASE
    • SQL Anywhere
    • Sybase IQ
    Use fully qualified names, including database, owner, and object.
    Quoted Identifier
    • ASE
    • SQL Anywhere
    • Sybase IQ
    Enable the quoted_identifier option that allows the interpretation of delimited strings to be changed.
    Grant Privilege Statements
    • ASE
    • SQL Anywhere
    • Sybase IQ
    Generate grant privileges statements.
    Table 2. Generate objects
    Option   Description
    Defaults
    • ASE
    Generate defaults.
    Dbspace
    • SQL Anywhere
    • Sybase IQ
    Generate a dbspace.
    Events
    • SQL Anywhere
    • Sybase IQ
    Generate events.
    Indexes
    • ASE
    • SQL Anywhere
    • Sybase IQ
    Generate indexes.
    Proxy Tables
    • ASE
    • SQL Anywhere
    • Sybase IQ
    Generate proxy tables.
    Rules
    • ASE
    Generate rules.
    Segments
    • ASE
    Generate database segments.
    Stored Procedures
    • ASE
    • SQL Anywhere
    • Sybase IQ
    Generate stored procedures.
    Tables
    • ASE
    • SQL Anywhere
    • Sybase IQ
    Generate tables.
    Triggers
    • ASE
    • SQL Anywhere
    Generate triggers.
    User-defined Functions
    • SQL Anywhere
    • Sybase IQ
    Generate user-defined functions.
    User-defined Types
    • ASE
    • SQL Anywhere
    • Sybase IQ
    Generate user-defined datatypes.
    Users and groups
    • ASE
    • SQL Anywhere
    • Sybase IQ
    Generate users and groups.
    Views
    • ASE
    • SQL Anywhere
    • Sybase IQ
    Generate views.
    Use Select All, Deslect All, and Restore Default to change all selections. Use Save As Default to update a default setting.
  3. Click Next, and choose the schema objects for which to generate DDL.
    Table 3. DDL generation
    Tab Description
    Default Select a database owner from the corresponding drop-down. To filter the list of generated objects, enter a name pattern in the Default text field, and click Filter. Select items from the list of generated objects.
    DBSpace To filter the list of generated objects, enter a name pattern in the DBSpace text field, and click Filter. Select items from the list of generated objects.
    Event To filter the list of generated objects, enter a name pattern in the Event text field, and click Filter. Select items from the list of generated objects.
    Index Select a database owner from the corresponding drop-down. To filter the list of generated objects, enter a name pattern in the Table text field, and click Filter. Select items from the list of generated objects.
    Proxy Table Select a database owner from the corresponding drop-down. To filter the list of generated objects, enter a name pattern in the Proxy Table text field, and click Filter. Select items from the list of generated objects.
    Rule Select a database owner from the corresponding drop-down. To filter the list of generated objects, enter a name pattern in the Rule text field, and click Filter. Select items from the list of generated objects.
    Segment To filter the list of generated objects, enter a name pattern in the Segment text field, and click Filter. Select items from the list of generated objects.
    Procedure Select a database owner from the corresponding drop-down. To filter the list of generated objects, enter a name pattern in the Procedure text field, and click Filter. Select items from the list of generated objects.
    Table Select a database owner from the corresponding drop-down. To filter the list of generated objects, enter a name pattern in the Table text field, and click Filter. Select items from the list of generated objects.
    Trigger Select a database owner from the corresponding drop-down. To filter the list of generated objects, enter a name pattern in the Table text field, and click Filter. Select items from the list of generated objects.
    Function Select a database owner from the corresponding drop-down. To filter the list of generated objects, enter a name pattern in the Function text field, and click Filter. Select items from the list of generated objects.
    User Defined Type Select a database owner from the corresponding drop-down. To filter the list of generated objects, enter a name pattern in the User-Defined Type text field, and click Filter. Select items from the list of generated objects.
    User Group To filter the list of generated objects, enter a name pattern in the User Group text field, and click Filter. Select items from the list of generated objects.
    View Select a database owner from the corresponding drop-down. To filter the list of generated objects, enter a name pattern in the View text field, and click Filter. Select items from the list of generated objects.
    Use Select All, Deslect All, and Invert Selection to change selections. Click Preview to preview DDL for a selected object.
  4. Click Next, and specify save and execution properties for the DDL.
    Field Description
    Generate Script Generate the script for the DDL.
    Enter or select the parent folder Specify an existing project or create a new project in which to save the SQL.
    Single File Enter the name of the file in which to store the SQL.
    Multiple Files Select this option to store the DDL in multiple files. Click Options to specify the following file options:
    • Prefix – specify a prefix for the file name.
    • Suffix – specify a suffix for the file name.
    • Group Style – create one file for every object, or group objects into files by object type.
    • Add Database Name as Prefix – use the database name as the file prefix.
    • Create folder for each type – create a folder for each object type.
    Generate Full Hierarchy Generate the DDL files with the hierarchy displayed for databases in Enterprise Explorer.
    Execute Immediately This option is unselected by default. Sybase recommends that you generate and run the script for the DDL before executing it.

    Selecting this option executes the SQL immediately. If you do not select this option, you must complete execution of the SQL later to create the objects.

    Connection profile Specify a connection profile, including the connection type, data server name, and database name.
  5. Click Finish to generate the DDL.
Related concepts
Data Definition Language Generation
Related tasks
Viewing the Database Definition Language for a Table
Viewing the Database Definition Language for a Table
Related reference
DDL Gen Options

For product-related issues, contact Sybase Technical Support at 1-800-8SYBASE. Send your feedback on this help topic directly to Sybase Technical Publications: pubs@sybase.com