Troubleshooting Default values for Adaptive Server Anywhere uniqueidentifiers

  1. Uniqueidentifiers are treated as binary datatypes in Unwired WorkSpace. If the enterprise information system (EIS) on which the uniqueidentifier resides:
    • Accepts NULL as a valid value, you can set the default value to NULL.
    • Does not accept NULL as a valid value, you need to set the correct default value. By default Unwired WorkSpace uses an empty string as the default value for binary datatypes.
  2. To avoid entering values for the UNIQUEIDENTIFIER columns during insert operations, modify the default SQL definition as this example illustrates:
    1. Create an Adaptive Server Anywhere table with SQL:
      CREATE TABLE dba.YorkTable ( 
      UniqueColumn UNIQUEIDENTIFIER NOT NULL DEFAULT NEWID(), 
      Characters VARCHAR(10) NOT NULL, 
      ) 
      IN SYSTEM 
      ; 
      ALTER TABLE dba.YorkTable 
      ADD CONSTRAINT ASA126 PRIMARY KEY NONCLUSTERED (UniqueColumn) 
      ; 
      
    2. Drag-and-drop the table to create the new MBO.
      The auto-generated Create operation SQL is:
      "INSERT INTO sampledb.dba.YorkTable (UniqueColumn, Characters) VALUES 
      (:UniqueColumn, :Characters)"
    3. To avoid entering values for the UNIQUEIDENTIFIER column during insert operations, change the SQL definition to:
      "INSERT INTO sampledb.dba.YorkTable (Characters) VALUES (:Characters)"
  3. For operations that use uniqueidentifier datatype argument default values, change the default operation argument datatype to a String instead of the automatically generated Binary from the Operation Parameters tab in Unwired WorkSpace.
Related tasks
Binding an MBO to a Database Fails
Multilevel Insert Operation Fails
Related reference
MBO Retrieves Incorrect Data
Relationship Error
Warning Message When Creating Relationships