Datatype Default Values

This topic provides information about datatype default values that can be set for mobile business object (MBO) attributes and parameters.

You can provide a default value for attributes and parameters that are compatible with their datatype (and used by the device application to pass to the MBO), where ever you specify a datatype (Properties view, Preview dialog, and so on).
Note: When possible, the default value is retrieved with an appropriate value from the data source when you bind to the data source, which you can then modify.

NULL and NO DEFAULT Default values

It is important to understand the differences between the default values NULL and NO DEFAULT:
  • NULL – not all datatypes support NULL as a value (int, decimal, double, float, and so on). After an MBO is created, NULL may be an available default value, but should not be selected if NULL is invalid for that datatype. If NULL is selected, and is invalid for the datatype, errors occur either when you deploy the MBO to Unwired Server, or when a device application interacts with the deployed MBO. These examples illustrate how a device application behaves when an MBO contains a synchronization parameter equal to NULL:
    • Where NULL is supported – the device application receives the rows where the attribute in the MBO is NULL. If a synchronization playback parameter is NULL, then the playback is performed using the value NULL.
    • Where NULL is not supported – if the Filter by setting is used to associate synchronization parameter X with attribute X, the download cursor is similar to:
      select ... from my_table t where t.last_modified >= ... and t.x >= :X
      If X is NULL, no rows are returned, since (t.x >= :X) is false in the database if X is NULL.

  • NO DEFAULT – represents no value and is supported by all datatypes as a default value. NO DEFAULT can also be used if a parameter is to be supplied by the Fill from attribute option.

SAP attribute and parameter datatypes do not support NULL as a default value. If the data source is SAP and no default value is specified, the default value is an empty string.

Example 1

SQL format of NULL for Date, Time, and Datetime datatypes.
select * from my_date 
where 
(dateformat(c2,'yyyy-mm-dd') = dateformat('@OP[''Date''='''']', 'yyyy-mm-dd'))  
OR (c2 IS NULL AND '@OP[''Date''='''']' IS NULL)


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