Troubleshooting Default Values for Adaptive Server® Anywhere uniqueidentifiers

Keep these points in mind when working with 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 concepts
AutoCommit Option for JDBC MBOs Using an ASE Data Source
Passing an Empty String or Byte into a Required Binary Column in ASE
Related tasks
Binding an MBO to a Database Fails
Multilevel Insert Operation Fails
Attribute Length Set Incorrectly for Operation and Load Arguments
Unable to properly update the CDB because the partition was improperly assigned
Related reference
MBO Retrieves Incorrect Data
Relationship Error
Warning Message When Creating Relationships
Preview Errors for a Web Service Mobile Business Object with date/time Types
Web Service Mobile Business Object Must Be Connected to Connection Profile
Refresh Fails Due to Missing Load Argument Default Values
Input Parameters Fail to Generate for Complex Data Sources
Output Mapping Warning Message for Multilevel Insert Operations
Syntax Errors When Creating a Database Mobile Business Object
Sybase MBOs That Invalidate the Cache